Skip to content

liblog.LogMessage class

Bodo Hugo Barwich edited this page Nov 2, 2021 · 25 revisions
Home Trees Indices Help LogMessage

Module liblog :: Class LogMessage

Class LogMessage

object --+
         |
        **LogMessage**

This is a Class to manage accumulative Log and Error strings and the numeric Error Code and return them as single String
It offers Methods to progressively add Messages to the Log or Error Registry
The Error Code is accumulative since it keeps only the Highest Value.
It publishes the complete merged Message as Properties


See Also: LogMessage.report, LogMessage.error, LogMessage.code

Instance Methods

Return Value Method Name Source
__init__(self, logmessage='', errormessage='', errorcode=0)
A LogMessage Object can be instanciated providing initial Report Message, Error Message and Error Code
source code
__del__(self)
On Destruction the Lists of strings will be freed
source code
addReport(self, message)
Adds a Message to the Report String
source code
addError(self, message, code=0)
Adds an Error Message and an Error Code. Errors are treated in an accumulative way that means that the Error Code is only overwritten by an higher Error Code as described in LogMessage.addErrorCode
source code
setReport(self, message='')
This Method sets by Replacement the LogMessage.report string
source code
setError(self, message='', code=None)
This Method sets by Replacement the LogMessage.error string and sets and replaces theLogMessage.code Error Code
source code
addErrorCode(self, code)
This will keep the Highest added Error Code in the Attribute LogMessage.code
setErrorCode(self, code=0)
This will overwrite the existing Error Code with the new Error Code
source code
clear(self)
Resets the LogMessage.report, LogMessage.error and LogMessage.code Property It empties the Lists and resets the Output Buffer.
source code
list[string] getReportArray(self)
Returns: The Report Messages as List of Strings
source code
list[string] getErrorArray(self)
Returns: The Error Messages as List of Strings
source code
string getReportString(self)
LogMessage.report Attribute which represents All Report Messages
source code
string getErrorString(self)
LogMessage.error Attribute which represents All Error Messages
source code
integer getErrorCode(self)
LogMessage.code Attribute which represents the Highest Error Code
source code

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

Properties

Data Type Property Name
string report
LogMessage.report Attribute which represents All Report Messages
string error
LogMessage.error Attribute which represents All Error Messages
integer code
LogMessage.code Attribute which represents the Highest Error Code

Inherited fromobject: __class__

Method Details

init(self, logmessage='', errormessage='', errorcode=0)

(Constructor)

A LogMessage Object can be instanciated providing initial Report Message, Error Message and Error Code

Parameters:

  • logmessage (string) - A string Message that will be stored as LogMessage.report string Property
  • errormessage (string) - A string Message that will be stored as LogMessage.error string Property
  • errorcode (integer) - A whole Number that will be stored single LogMessage.code numeric Property

Overrides: object.__init__

See Also:
LogMessage.report, LogMessage.error, LogMessage.code

addReport(self, message)

Adds a Message to the Report String

Parameters:

  • message (string) - A String that will be added to the LogMessage.report string Property

See Also: LogMessage.report

addError(self, message, code=0)

Adds an Error Message and an Error Code. Errors are treated in an accumulative way that means that the Error Code is only overwritten by an higher Error Code as described in LogMessage.addErrorCode

Parameters:

  • message (string) - The Message to be added to the LogMessage.error Property
  • code (integer) - The Error Code to be added

See Also: LogMessage.addErrorCode

setReport(self, message='')

This Method sets by Replacement the LogMessage.report string

Parameters:

  • message (string) - The Message string thet replaces the former Report Message string

setError(self, message='', code=None)

This Method sets by Replacement the [LogMessage.error](liblog.LogMessage- class#error) string and sets and replaces the LogMessage.code Error Code

Parameters:

  • message (string) - The Message string that replaces former the former Error Message String
  • code (integer) - The Error Code that replaces the former Error Code

addErrorCode(self, code)

This will keep the Highest added Error Code in the Attribute LogMessage.code

Parameters:

  • code (integer) - The Error Code to be added

setErrorCode(self, code=0)

This will overwrite the existing Error Code with the new Error Code

Parameters:

  • code (integer) - The Error Code to overwrite the existing one

getReportArray(self)

Returns: list[string]
The Report Messages as List of Strings

getErrorArray(self)

Returns: list[string]
The Error Messages as List of Strings

getReportString(self)

LogMessage.report Attribute which represents All Report Messages

Returns: string
All Report Messages as single String joined each Message in a new Line

getErrorString(self)

LogMessage.error Attribute which represents All Error Messages

Returns: string
All Error Messages as single String joined each Massage in a new Line

getErrorCode(self)

LogMessage.code Attribute which represents the Highest Error Code

Returns: integer
The Highest recorded Error Code

Property Details

report

LogMessage.report Attribute which represents All Report Messages

Get Method:
getReportString(self) - LogMessage.report Attribute which represents All Report Messages Set Method:
setReport(self, message='') - This Method sets by Replacement the LogMessage.report string Type:
string

error

LogMessage.error Attribute which represents All Error Messages

Get Method:
getErrorString(self) - LogMessage.error Attribute which represents All Error Messages Set Method:
setError(self, message='', code=None) - This Method sets by Replacement the LogMessage.error string and sets and replaces the LogMessage.code Error Code Type:
string

code

LogMessage.code Attribute which represents the Highest Error Code

Get Method:
getErrorCode(self) - LogMessage.code Attribute which represents the Highest Error Code Set Method:
setErrorCode(self, code=0) - This will overwrite the existing Error Code with the new Error Code Type:
integer

Home Trees Indices Help LogMessage

Generated by Epydoc 3.0.1 on Thu Nov 1 22:12:58 2018 | http://epydoc.sourceforge.net