close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
- Timestamp:
-
Aug 4, 2008, 4:29:27 PM (16 years ago)
- Author:
-
cmlenz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v4
|
v5
|
|
10 | 10 | |
11 | 11 | This functionality is implemented by the module [source:trunk/diva/ext/firephp.py diva.ext.firephp]. It requires [http://code.google.com/p/simplejson/ simplejson] to be installed. |
| 12 | |
| 13 | It is implemented by a custom logging handler for the [http://docs.python.org/lib/module-logging.html logging package] from the standard library. FirePHP logging is enabled by default when you use the DevelopmentServer, but is also easy to add for other kinds of deployments, for example: |
| 14 | |
| 15 | {{{ |
| 16 | #!python |
| 17 | import logging |
| 18 | from diva.ext.firephp import FirePHPHandler |
| 19 | |
| 20 | logging.root.setLevel(logging.DEBUG) |
| 21 | |
| 22 | logfile = logging.FileHandler('/var/log/myapp/python.log') |
| 23 | logfile.setLevel(log_level) |
| 24 | logfile.setFormatter(logging.Formatter('%(asctime)s %(levelname)-8s %(message)s')) |
| 25 | logging.root.addHandler(logfile) |
| 26 | |
| 27 | firephp = FirePHPHandler() |
| 28 | firephp.setLevel(logging.DEBUG) |
| 29 | logging.root.addHandler(firephp) |
| 30 | }}} |
| 31 | |