Home > flu-log-mirror

flu-log-mirror

Flu-log-mirror is a project mainly written in Python, it's free.

a very simple mirror of the flumotion.extern.log-module for easier git-submoduling

This module does logging.

Suggested use in your project (if you are using Subversion):

  • create myproject/extern directory
  • svn commit myproject/extern
  • svn propset svn:externals "log https://core.fluendo.com/svn/flumotion/trunk/flumotion/extern/log" myproject/extern
  • in your project:
    • call log.init('MY_PROJECT_DEBUG') (where MY_PROJECT_DEBUG is the name of the enviroment variable you want to have the debug output controlled by)
    • call log.setPackageScrubList('myproject') to have the filename logging be relative to your myproject package/module.
    • call log.setDebug(myDebugString) to change the logging levels.

Alternatively, you can embed only the log.py file with proper svn:externals.

If you are worried about stability, check out a specific revision by putting -r (revision number) in between log and https

BUGS

The logging strings should be strings, not unicode.

Unicode objects are encoded with UTF-8 before being logged.

log.getExceptionMessage() is not always able to extract the stack properly; there doesn't seem to be a good way to do so. Instead, it will take the stack from the last raise context, so call this function before passing the exception down somewhere else where it could hit another raise first.