maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Include timestamps and some details in the logg


From: David Decotigny
Subject: [Maposmatic-dev] [PATCH] Include timestamps and some details in the logging message
Date: Thu, 10 Sep 2009 22:49:44 +0200

This patch changes the format of the log messages, adding timestamps,
log levels, etc. It could be interesting to setup a more customizable
logging scheme, as per
http://docs.python.org/library/logging.html#configuring-logging
---
 www/settings.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/www/settings.py b/www/settings.py
index 4a26d10..4e4d1e0 100644
--- a/www/settings.py
+++ b/www/settings.py
@@ -117,6 +117,8 @@ try:
 except KeyError:
     _fh = logging.FileHandler('maposmatic.log')
 
+_lf = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
+_fh.setFormatter(_lf)
 LOG.addHandler(_fh)
 LOG.info("log restarted.")
 
-- 
1.6.0.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]