forked from github/pelican
Added shortcuts functions in the `log' module
This commit is contained in:
parent
c5578e338d
commit
834c952f20
1 changed files with 8 additions and 0 deletions
|
|
@ -66,6 +66,14 @@ class Formatter(object):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# shortcuts
|
||||||
|
debug, info, warn, error, critical = (logging.debug,
|
||||||
|
logging.info,
|
||||||
|
logging.warn,
|
||||||
|
logging.error,
|
||||||
|
logging.critical)
|
||||||
|
|
||||||
|
|
||||||
def init(logger=logging.getLogger(), handler=logging.StreamHandler()):
|
def init(logger=logging.getLogger(), handler=logging.StreamHandler()):
|
||||||
fmt = Formatter()
|
fmt = Formatter()
|
||||||
handler.setFormatter(fmt)
|
handler.setFormatter(fmt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue