~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: John Arbash Meinel
  • Date: 2010-05-12 15:01:44 UTC
  • mto: This revision was merged to the branch mainline in revision 435.
  • Revision ID: john@arbash-meinel.com-20100512150144-vfxru5xvfqldwcbm
Reduce simpletal spam w/ --log-level=DEBUG, we *never* want that.

But if --log-level=warning, we don't want INFO messages either.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
        logger.addHandler(handler)
72
72
        logging.getLogger('simpleTAL').addHandler(handler)
73
73
        logging.getLogger('simpleTALES').addHandler(handler)
 
74
        def _restrict_logging(logger_name):
 
75
            logger = logging.getLogger(logger_name)
 
76
            if logger.getEffectiveLevel() < logging.INFO:
 
77
                logger.setLevel(logging.INFO)
 
78
        # simpleTAL is *very* verbose in DEBUG mode, which is otherwise the
 
79
        # default. So quiet it up a bit.
 
80
        _restrict_logging('simpleTAL')
 
81
        _restrict_logging('simpleTALES')
 
82
 
 
83
 
74
84
 
75
85
    def serve_http(transport, host=None, port=None, inet=None):
76
86
        from paste.httpexceptions import HTTPExceptionHandler