-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
33 lines (26 loc) · 1.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.