LogFile

class biskit.LogFile(fname, mode='w')[source]

Bases: object

Simple log file that can be passed between objects. It is flushed after each writing and should hence always be up2date.

Methods Overview

__init__
param fname:name of log file :type fname: str :param mode: mode (default: w) :type mode: str
add Add new line to logfile and flush
add_nobreak Add new line without creating a linebreak to logfile and flush
f Open file only when needed for first time.
write Synonym for add_nobreak.
writeln Synonym for add.

LogFile Method & Attribute Details

__init__(fname, mode='w')[source]
Parameters:
  • fname (str) – name of log file
  • mode (str) – mode (default: w)
f()[source]

Open file only when needed for first time.

Returns:open file handle
Return type:object
write(s)[source]

Synonym for add_nobreak. :param s: line :type s: str

writeln(s)[source]

Synonym for add. :param s: line :type s: str

add(s)[source]

Add new line to logfile and flush

Parameters:s (str) – line
add_nobreak(s)[source]

Add new line without creating a linebreak to logfile and flush

Parameters:s (str) – line