module loghelper.custom_log

Inheritance diagram of pyquickhelper.loghelper.custom_log

Short summary

module pyquickhelper.loghelper.custom_log

Creates a custom log (open a text file and flushes everything in it).

source on GitHub

Classes

class

truncated documentation

CustomLog

Implements a custom logging function. This class is not protected against multithreading. Usage:

Properties

property

truncated documentation

filename

returns _filename

fullpath

returns _fullpath

Methods

method

truncated documentation

__call__

Log anything.

__del__

Closes the stream if needed.

__init__

initialisation

fLOG

Builds a message on a single line with the date, it deals with encoding issues.

Documentation

Creates a custom log (open a text file and flushes everything in it).

source on GitHub

class pyquickhelper.loghelper.custom_log.CustomLog(folder=None, filename=None, create=True, parent=None)[source][source]

Bases: object

Implements a custom logging function. This class is not protected against multithreading. Usage:

clog = CustomLog("folder")
clog('[fct]', info)

source on GitHub

initialisation

Parameters
  • folder – folder (created if not exists)

  • filename – new filename

  • create – force the creation

  • parent – logging function (called after this one if not None)

source on GitHub

__call__(*l, **p)[source][source]

Log anything.

source on GitHub

__del__()[source][source]

Closes the stream if needed.

source on GitHub

__init__(folder=None, filename=None, create=True, parent=None)[source][source]

initialisation

Parameters
  • folder – folder (created if not exists)

  • filename – new filename

  • create – force the creation

  • parent – logging function (called after this one if not None)

source on GitHub

fLOG(*l, **p)[source][source]

Builds a message on a single line with the date, it deals with encoding issues.

Parameters
  • l – list of fields

  • p – dictionary of fields

source on GitHub

property filename[source]

returns _filename

source on GitHub

property fullpath[source]

returns _fullpath

source on GitHub