:rat:ratlog python库-老鼠、人类和机器的应用程序日志
ratlog的Python项目详细描述
:rat:ratlog.py
老鼠、人类和机器的应用程序日志
Disclaimer:The Ratlog specification is still alpha status and might be subject to breaking changes. Beware, because of that, this API and format might change significantly. We will try our best to tag a stable release as soon as possible. Leave feedback and help us get there faster!
>>>importratlog>>>log=ratlog.Log()>>>log("hello world")helloworld# Add fields>>>log("counting",{"count":1})counting|count:1# Add fields and tag>>>log("counting",{"count":-1},"negative")[negative]counting|count:-1# Create another logger bound to a tag>>>warn=ratlog.Log("warning")>>>warn("disk space low")[warning]diskspacelow# Adding more tags>>>crit=ratlog.Log("warning","critical")>>>crit("shutting down all servers")[warning|critical]shuttingdownallservers