LogFile — biskit 3.0.0a1 documentation

# LogFile

class `biskit.` `LogFile`(fname, mode='w')

  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')

    Parameters: | fname (str) – name of log file mode (str) – mode (default: w)

  `f`()

    Open file only when needed for first time.

    Returns: | open file handle
    Return type: | object

  `write`(s)

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

  `writeln`(s)

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

  `add`(s)

    Add new line to logfile and flush

    Parameters: | s (str) – line

  `add_nobreak`(s)

    Add new line without creating a linebreak to logfile and flush

    Parameters: | s (str) – line