Package wsatools :: Package DbConnect :: Module IngIngester :: Class IngestLogger
[hide private]

Class IngestLogger

source code


A logger class based on Logger, but appends to the log on __del__ instead of writing.


Note: Do not set the isVerbose option of this class to False, otherwise old logs will be overwritten and the last log doubled up. This will change once there is a writeMode argument.

To Do: This class will become obsolete, probably by giving Logger a writeMode argument to the constructor, with a default of 'w'. Need to be sure that the log reset is OK too. If class stays it will be renamed and moved into Logger.py.

Instance Methods [hide private]
 
__del__(self)
Appends all messages that have been currently logged.
source code

Inherited from Logger.Logger: __init__

Inherited from Logger.Logger (private): _revertToHomePath

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
append(fileName, reset=True) source code
 
addText(message, alwaysLog=True)
Log a message without timestamp.
source code

Inherited from Logger.Logger: addExceptionDetails, addExceptionMessage, addExceptionWarning, addMessage, dump, extractExceptionDetails, reset, setEchoOff, setEchoOn

Class Variables [hide private]

Inherited from Logger.Logger: archive, echoOn, isVerbose, pathName, reqClearLine

Inherited from Logger.Logger (private): _logText, _logTime

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__del__(self)
(Destructor)

source code 

Appends all messages that have been currently logged.

Overrides: Logger.Logger.__del__

addText(message, alwaysLog=True)
Static Method

source code 

Log a message without timestamp. This is displayed to stdout if in "echoOn" mode, and also written to the log file if not in "isVerbose" mode.

Parameters:
  • message (str) - The message to log.
  • alwaysLog (bool) - If False, then this message will only be logged when isVerbose is True.