Skip to content

log


=== Author: Assaf Ben Zur ===

Core mns logger.

This module contains the mns logger which will construct a log based on given parametrs.

All logs are written to the defined log file dectated by the project globals.

In case a log doesn't exists it will be automatically created.


Defenitions


getCurrentFunctionName

Constructor: getCurrentFunctionName()
Return: None
Arguments:
Keyword Arguments:


getPreviousFunctionName

Constructor: getPreviousFunctionName()
Return: None
Arguments:
Keyword Arguments:


log

Core logger function.

Given a message line and a severity parameter, log the line into the log file.

In case the log file doesn't exist, create one.

In case the directory doesn't exist, create one.

An output message is printed into the consule based on the severity.

severities(svr):

0 = log

1 = msg

2 = warning

3 = error

4 = fatal


Constructor: log(msg = "", **kwargs)
Return: None
Arguments:
  • msg(str) ; [default: ""]
  • **kwargs
Keyword Arguments:
  • svr(int) - set the sevarity of the log message
  • currentContextRequested(bool) - in case a global context log was called


logCurrentFrame

Log the current requested frame.

The frame is collected procedurally from the dtack, without needing to pass any arguments into methed.


Constructor: logCurrentFrame()
Return: None
Arguments:
Keyword Arguments:


validateLogRootDirectory

Validate log directory existence within the current project folder.


Constructor: validateLogRootDirectory()
Return: string (log directory path)
Arguments:
Keyword Arguments: