Skip to content

Flumotion/flog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Thomas Vander Stichele
Jan 13, 2013
f1cb381 · Jan 13, 2013

History

60 Commits
Jan 13, 2013
Jan 10, 2013
Jan 10, 2013
Dec 21, 2010
Jan 13, 2013

Repository files navigation

This module does logging.

Suggested use in your project:

- embed the module
  - create myproject/extern directory
  - git submodule add git://github.com/Flumotion/flog myproject/extern/flog
  - cd myproject/extern
  - ln -sf flog/log .
  - git add log
  - git commit -m "adding flumotion log submodule"

- use it:
  - from myproject.extern.log import log
  - call log.init('MY_PROJECT_DEBUG')
    (where MY_PROJECT_DEBUG is the name of the environment 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.

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.