Ignore:
Timestamp:
9 Nov 2012, 15:35:08 (12 years ago)
Author:
uli
Message:

Add a logging NullHandler? for Python < 2.7 compatibility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py

    r9372 r9593  
    2121import datetime
    2222import imghdr
     23import logging
    2324import os
    2425import pytz
     
    697698        result *= item
    698699    return result
     700
     701class NullHandler(logging.Handler):
     702    """A logging NullHandler.
     703
     704    Does not log anything. Useful if you want to shut up a log.
     705
     706    Defined here for backwards compatibility with Python < 2.7.
     707    """
     708    def emit(self, record):
     709        pass
Note: See TracChangeset for help on using the changeset viewer.