Skip to content

Commit

Permalink
Make Logger.loglevel a class attribute.
Browse files Browse the repository at this point in the history
This way it will be easier to change log level of a custom
Logger class:

    class MyLogger(gunicorn.glogging.Logger):

        loglevel = logging.WARNING
  • Loading branch information
berkerpeksag committed Feb 6, 2015
1 parent 38a61e4 commit b8cdfaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gunicorn/glogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Logger(object):
"info": logging.INFO,
"debug": logging.DEBUG
}
loglevel = logging.INFO

error_fmt = r"%(asctime)s [%(process)d] [%(levelname)s] %(message)s"
datefmt = r"[%Y-%m-%d %H:%M:%S %z]"
Expand All @@ -171,7 +172,6 @@ def __init__(self, cfg):
self.access_log.propagate = False
self.error_handlers = []
self.access_handlers = []
self.loglevel = logging.INFO
self.cfg = cfg
self.setup(cfg)

Expand Down

0 comments on commit b8cdfaa

Please sign in to comment.