Formatted docstring

This commit is contained in:
Rudi Grinberg 2012-10-25 14:49:49 -04:00
parent b2650b9a21
commit 0f1e843017
1 changed files with 6 additions and 10 deletions

View File

@ -6,23 +6,19 @@ from media.monitor.pure import LazyProperty
appname = 'root' appname = 'root'
def setup_logging(log_path): def setup_logging(log_path):
""" """ Setup logging by writing log to 'log_path' """
Setup logging by writing log to 'log_path'
"""
#logger = logging.getLogger(appname) #logger = logging.getLogger(appname)
logging.basicConfig(filename=log_path, level=logging.DEBUG) logging.basicConfig(filename=log_path, level=logging.DEBUG)
def get_logger(): def get_logger():
""" """ in case we want to use the common logger from a procedural
in case we want to use the common logger from a procedural interface interface """
"""
return logging.getLogger() return logging.getLogger()
class Loggable(object): class Loggable(object):
""" """ Any class that wants to log can inherit from this class and
Any class that wants to log can inherit from this class and automatically automatically get a logger attribute that can be used like:
get a logger attribute that can be used like: self.logger.info(...) etc. self.logger.info(...) etc. """
"""
__metaclass__ = abc.ABCMeta __metaclass__ = abc.ABCMeta
@LazyProperty @LazyProperty
def logger(self): return get_logger() def logger(self): return get_logger()