Formatted docstring
This commit is contained in:
parent
b2650b9a21
commit
0f1e843017
python_apps/media-monitor2/media/monitor
|
@ -6,23 +6,19 @@ from media.monitor.pure import LazyProperty
|
|||
appname = 'root'
|
||||
|
||||
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)
|
||||
logging.basicConfig(filename=log_path, level=logging.DEBUG)
|
||||
|
||||
def get_logger():
|
||||
"""
|
||||
in case we want to use the common logger from a procedural interface
|
||||
"""
|
||||
""" in case we want to use the common logger from a procedural
|
||||
interface """
|
||||
return logging.getLogger()
|
||||
|
||||
class Loggable(object):
|
||||
"""
|
||||
Any class that wants to log can inherit from this class and automatically
|
||||
get a logger attribute that can be used like: self.logger.info(...) etc.
|
||||
"""
|
||||
""" Any class that wants to log can inherit from this class and
|
||||
automatically get a logger attribute that can be used like:
|
||||
self.logger.info(...) etc. """
|
||||
__metaclass__ = abc.ABCMeta
|
||||
@LazyProperty
|
||||
def logger(self): return get_logger()
|
||||
|
|
Loading…
Reference in New Issue