MECO™ API Reference
Public Member Functions | List of all members
mMeco.core.loggerLib.Logger Class Reference

[ CLASS ] - Logger. More...

Inheritance diagram for mMeco.core.loggerLib.Logger:
mMeco.core.displayLib.Display

Public Member Functions

def __init__ (self, logFile=None)
 Constructor. More...
 
def file (self)
 Property. More...
 
def hasFailure (self)
 Property. More...
 
def setFile (self, logFile, discardExisting=True)
 Set log file. More...
 
def addInfo (self, message)
 Add info. More...
 
def addSuccess (self, message)
 Add success. More...
 
def addWarning (self, message)
 Add warning. More...
 
def addFailure (self, message)
 Add failure. More...
 
def getLastFailure (self)
 Get last failure. More...
 
def displayLastFailure (self)
 Display last failure. More...
 
def write (self, append=False)
 Write the log into log file. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mMeco.core.displayLib.Display
def displayInfo (text, startNewLine=True, endNewLine=True, useColor=True)
 Display given text in info format. More...
 
def displaySuccess (text, startNewLine=True, endNewLine=True, useColor=True)
 Display given text in success format. More...
 
def displayWarning (text, startNewLine=True, endNewLine=True, useColor=True)
 Display given text in warning format. More...
 
def displayFailure (text, startNewLine=True, endNewLine=True, useColor=True, stdErr=False)
 Display given text in failure format. More...
 
def displayHeaderLine (text, startNewLine=True, endNewLine=True, useColor=True)
 Display header line. More...
 
def displayHeaderText (text, startNewLine=False, endNewLine=False, useColor=True)
 Display header text. More...
 
def display (text, startNewLine=True, endNewLine=True, useColor=True, color=None, out=sys.stdout)
 Display given text by using file like object. More...
 
def displayStdOut (text, startNewLine=True, endNewLine=True)
 Display given text by using stdout. More...
 
def displayStdErr (text, startNewLine=True, endNewLine=True)
 Display given text by using stderr. More...
 
def displayBlankLine (count=1, out=sys.stdout)
 Display blank lines by giving counts. More...
 
def getDisplayColor (color)
 Get display color string for given color based on current platform. More...
 

Detailed Description

[ CLASS ] - Logger.

Constructor & Destructor Documentation

◆ __init__()

def mMeco.core.loggerLib.Logger.__init__ (   self,
  logFile = None 
)

Constructor.

Parameters
logFile[ str | None | in ] - Absolute path of a log file.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ file()

def mMeco.core.loggerLib.Logger.file (   self)

Property.

Exceptions
N/A
Returns
str - Value.

◆ hasFailure()

def mMeco.core.loggerLib.Logger.hasFailure (   self)

Property.

Exceptions
N/A
Returns
bool - Value.

◆ setFile()

def mMeco.core.loggerLib.Logger.setFile (   self,
  logFile,
  discardExisting = True 
)

Set log file.

Parameters
logFile[ str | None | in ] - Absolute path of a log file.
discardExisting[ bool | None | in ] - Discard existing log file, therefore do not append and create a new log file.
Exceptions
N/A
Returns
str - Value.

◆ addInfo()

def mMeco.core.loggerLib.Logger.addInfo (   self,
  message 
)

Add info.

Parameters
message[ str | None | in ] - Message.
Exceptions
N/A
Returns
None - None.

◆ addSuccess()

def mMeco.core.loggerLib.Logger.addSuccess (   self,
  message 
)

Add success.

Parameters
message[ str | None | in ] - Message.
Exceptions
N/A
Returns
None - None.

◆ addWarning()

def mMeco.core.loggerLib.Logger.addWarning (   self,
  message 
)

Add warning.

Parameters
message[ str | None | in ] - Message.
Exceptions
N/A
Returns
None - None.

◆ addFailure()

def mMeco.core.loggerLib.Logger.addFailure (   self,
  message 
)

Add failure.

Parameters
message[ str | None | in ] - Message.
Exceptions
N/A
Returns
None - None.

◆ getLastFailure()

def mMeco.core.loggerLib.Logger.getLastFailure (   self)

Get last failure.

Exceptions
N/A
Returns
mMeco.loggerLib.Log - Log.
None - If no failure has been logged.

◆ displayLastFailure()

def mMeco.core.loggerLib.Logger.displayLastFailure (   self)

Display last failure.

Exceptions
N/A
Returns
None - None.

◆ write()

def mMeco.core.loggerLib.Logger.write (   self,
  append = False 
)

Write the log into log file.

Parameters
append[ bool | False | in ] - Append to log file.
Exceptions
N/A
Returns
str - Absolute path of the log file.

The documentation for this class was generated from the following file: