Mercurial > getan
changeset 66:13e3ec26dc36
Make the logging configurable for filename and level
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 25 May 2011 13:21:34 +0200 |
parents | a7a85e85e0eb |
children | 34a0f5c533bd |
files | getan/config.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/getan/config.py Wed May 25 11:12:15 2011 +0200 +++ b/getan/config.py Wed May 25 13:21:34 2011 +0200 @@ -13,16 +13,16 @@ logger = None -def initialize(): - setup_logging() +def initialize(level=logging.INFO, filename="getan.log"): + setup_logging(level, filename) setup_locale() -def setup_logging(): +def setup_logging(level, filename): global logger - logging.basicConfig(level=logging.INFO, + logging.basicConfig(level=level, format='%(asctime)s %(levelname)s %(message)s', - filename='getan.log', + filename=filename, filemode='w') logger = logging.getLogger()