Package Gnumed :: Package pycommon :: Module gmLog2 |
[frames] | no frames]

# Module gmLog2

source code

GNUmed logging framework setup.

All error logging, user notification and otherwise unhandled exception handling should go through classes or functions of this module.

Theory of operation:

This module tailors the standard logging framework to the needs of GNUmed.

By importing gmLog2 into your code you'll get the root logger send to a unicode file with messages in a format useful for debugging. The filename is either taken from the command line (--log-file=...) or derived from the name of the main application.

The log file will be found in one of the following standard locations:

1) given on the command line as "--log-file=LOGFILE" 2) ~/.<base_name>/<base_name>.log 3) /dir/of/binary/<base_name>.log (mainly for DOS/Windows)

where <base_name> is derived from the name of the main application.

If you want to specify just a directory for the log file you must end the --log-file definition with a slash.

By importing "logging" and getting a logger your modules never need to worry about the real message destination or whether at any given time there's a valid logger available.

Your MAIN module simply imports gmLog2 and all other modules will merrily and automagically start logging away.

Version: $Revision: 1.13 $

Author: K. Hilbert <Karsten.Hilbert@gmx.net>

License: GPL v2 or later (details at http://www.gnu.org)

Functions
flush() | source code
log_stack_trace(message=None) | source code
set_string_encoding(encoding=None) | source code

Variables
| AsciiName = ``[``'``<#0-0x00-nul>``'``,` `'``<#1-0x01-soh>``'``,` `'``<#2-0x02-stx>``'``...``
| __package__ = ``'``Gnumed.pycommon``'``

Imports: logging, sys, os, codecs, locale

Variables Details

  ### AsciiName Value:
      ['<#0-0x00-nul>',
       '<#1-0x01-soh>',
       '<#2-0x02-stx>',
       '<#3-0x03-etx>',
       '<#4-0x04-eot>',
       '<#5-0x05-enq>',
       '<#6-0x06-ack>',
       '<#7-0x07-bel>',
      ...