Wednesday, December 26, 2007

snoring through logging

been working on a simple logging module for npm, so far I've set it up to handle 3 different outputs, the usual STDERR for big problems, a regular log file for every thing but debugging, and a developers log file for use during debugging.


stderr
CRITICAL: critical message
ERROR: error message
WARNING: warning message
run log
2007-12-27 07:27:45,156: CRITICAL -:- critical message
2007-12-27 07:27:45,157: ERROR -:- error message
2007-12-27 07:27:45,157: WARNING -:- warning message
2007-12-27 07:27:45,158: INFO -:- info message
dev log
2007-12-27 07:27:45,156 root CRITICAL: logger.logger.py.73
         critical message
2007-12-27 07:27:45,157 root ERROR: logger.logger.py.74
         error message
2007-12-27 07:27:45,157 root WARNING: logger.logger.py.75
         warning message
2007-12-27 07:27:45,158 root INFO: logger.logger.py.76
         info message
2007-12-27 07:27:45,159 root DEBUG: logger.logger.py.77
         debug message

The formats are just a matter of what I find easy on the eyes, think the middle one could stand with a shorter date format.

I might ditch the idea of a second log file and just follow my original idea of being able to specify the level of logging to use. It'd also be less work then



Either way yee slice it, I need some freaking sleep... because I can't think no more.

:wq!

No comments:

Post a Comment