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]

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__(*args, **kwargs)[source]

Log anything.

source on GitHub

__del__()[source]

Closes the stream if needed.

source on GitHub

__init__(folder=None, filename=None, create=True, parent=None)[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(*args, **kwargs)[source]

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

Parameters:
  • args – list of fields

  • kwargs – dictionary of fields

source on GitHub

property filename[source]

returns _filename

source on GitHub

property fullpath[source]

returns _fullpath

source on GitHub