flaxsearch / flaxcode

Automatically exported from code.google.com/p/flaxcode
4 stars 1 forks source link

Unify logging code #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, on windows, some logging is done directly to the windows event
log, and some is done via the python logging module.  This should be
unified - we should use the python logging system everywhere (except for
errors which occur while trying to initialise the logging system, for which
we should use the windows logging system directly if running as a service,
and write a message to sys.stderr otherwise).

The python logging system should have a new "windowsservice" logger added
which all messages about starting or stopping the service will be sent to.
 These messages should be handled by a windows event handler (a custom one
may need to be written if python doesn't have one available by default),
but can also be handled by the normal handler so that they are included in
our main log file.

Then, flaxservice.py needs to have all instances of LogInfoMsg() and
LogErrorMsg() changed to use the python logging system.

Also, the logging configuration should be changed so that any "Critical"
level error messages are directed additionally to the windows event log
handler.

Finally, startflax.py should catch any uncaught exceptions in its main
handler, and write them to the logging subsystem (as critical level error
messages) rather than letting python handle them (which it will do by
writing a backtrace to stdout).  It should be sure to return an error code
if such an exception is caught, though.

Original issue reported on code.google.com by boulton.rj@gmail.com on 7 Nov 2007 at 10:57

GoogleCodeExporter commented 9 years ago

Original comment by charliej...@gmail.com on 19 Aug 2009 at 3:42