Skip to content

🐀 Ratlog Python library - Application Logging for Rats, Humans and Machines

License

Notifications You must be signed in to change notification settings

alxwrd/ratlog.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐀 Ratlog.py

Application Logging for Rats, Humans and Machines

Build Status Downloads

>>> import ratlog

>>> log = ratlog.Log()

>>> log("hello world")
hello world

# 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] disk space low

# Adding more tags
>>> crit = ratlog.Log("warning", "critical")
>>> crit("shutting down all servers")
[warning|critical] shutting down all servers