带有日志模块的mozlog
mozlogging的Python项目详细描述
mozlogging:带有日志模块的mozlog图片::https://img.shields.io/pypi/v/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
图片::https://img.shields.io/pypi/l/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
…图片::https://img.shields.io/pypi/wheel/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
图片::https://img.shields.io/pypi/pyversions/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
代码块::python
>;>import logging
>;>from mozlogging import mozlogformatter
>;>logger=logging.getlogger('example')
>;>handler=logging.streamhandler()
>;>handler.setformatter(mozlogformatter())
>;>logger.addhandler(handler)
>>>>logger.error({'dict':1,'of':2,'fields':3},'my.message.type')
{“envversion”:“2.0”,“fields”:{“dict”:1,“fields”:3,“of”:2},“logger”:“example”,“severity”:3,“timestamp”:1489366186847323648,“type”:“my.message.type”}
:目标:https://pypi.python.org/pypi/mozlogging
图片::https://img.shields.io/pypi/l/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
…图片::https://img.shields.io/pypi/wheel/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
图片::https://img.shields.io/pypi/pyversions/mozlogging.svg
:目标:https://pypi.python.org/pypi/mozlogging
代码块::python
>;>import logging
>;>from mozlogging import mozlogformatter
>;>logger=logging.getlogger('example')
>;>handler=logging.streamhandler()
>;>handler.setformatter(mozlogformatter())
>;>logger.addhandler(handler)
>>>>logger.error({'dict':1,'of':2,'fields':3},'my.message.type')
{“envversion”:“2.0”,“fields”:{“dict”:1,“fields”:3,“of”:2},“logger”:“example”,“severity”:3,“timestamp”:1489366186847323648,“type”:“my.message.type”}