module loghelper.custom_log
¶
Short summary¶
module pyquickhelper.loghelper.custom_log
Creates a custom log (open a text file and flushes everything in it).
Classes¶
class |
truncated documentation |
---|---|
Implements a custom logging function. This class is not protected against multithreading. Usage: |
Properties¶
property |
truncated documentation |
---|---|
returns _filename |
|
returns _fullpath |
Methods¶
method |
truncated documentation |
---|---|
Log anything. |
|
Closes the stream if needed. |
|
initialisation |
|
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).
- 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)
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)
- __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)
- 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