Logging

class dna.utils.Logger(path, append=False)[source]

Various utilities to interface with logs

Parameters
  • path (str) – the path to the logfile

  • append (bool) – whether to append to the logfile (defaults to False and overwrites logfile)

open()[source]

Open the logfile for writing

write(line)[source]

Write to the logfile

Parameters

line (str) – the line to write

pipe(gen)[source]

Pipe all output from gen to the logfile

Parameters

gen (generator) – the generator to pipe from

close()[source]

Close the logfile

file()[source]

Return the logfile object