mewlo.mpacks.core.eventlog.mlogtarget_python module

logger_pythontarget.py This module defines a derived logging class that uses python logger class to do the actual output. There are two problems with this code as is:

  • first, when writing the log line out, we are only using the level (if found) and the message, and ignoring any other dictionary values passed in.
  • second, the info about the location of the log message which python logging system is capable of capturing, is lost – as might be expected it always points back to us here.
To fix these we would like to:
  • first, have a way in the LogTarget_Python of configuring how to add log event dictionary items into the log message, or just serialize them onto the end.
  • second, have a way to grab the location fields of the event creation / original log event, and use that. One downside to this is the potential impact on cpu of this.
For more clues to this see:
class mewlo.mpacks.core.eventlog.mlogtarget_python.MewloLogTarget_Python(pythonlogger)[source]

Bases: mewlo.mpacks.core.eventlog.mlogger.MewloLogTarget

Target that hands off log writing duties to standard python logging classes.

classmethod make_simple_pythonlogger_tofile(pythonloggername, filepath, level=10)[source]

Class method to make a simple test file logger via python logging system.

process(logmessage, flag_isfromqueue)[source]

Called by logger parent to actually do the work. We overide this in our subclass to do actual work.

write(logmessage, flag_isfromqueue)[source]

Write out the logmessage to the python logger. ATTN:TODO - instead of str(logmessage) we should strip out the dictionary keys and write them.

Table Of Contents

Previous topic

mewlo.mpacks.core.eventlog.mlogtarget_file module

Next topic

mewlo.mpacks.core.eventlog.mlogtarget_sinkhole module

This Page