Skip to content

A straightforward logging utility library

Notifications You must be signed in to change notification settings

tangibleintelligence/clearcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clearcut: A straightforward and lightweight logging wrapper library

Build Status

This provides some helpful wrapper and util functions for logging, and formats log messages in a more human-readable way by default.

Use

At the top of the file:

from clearcut import get_logger

...

logger = get_logger(__name__)

Logging can be performed ad-hoc:

logger.info("info log")
logger.warning("warn log", exc_info=e)

"log blocks" can also be created which automatically log entrance/exits as well as performance information

from clearcut import log_block, get_logger

...

logger = get_logger(__name__)

...

with log_block("block name", logger):
    ...

TODO

  • Would like to use contextvars to create a contextmanager where additional "metadata" can be specified (and unspecified) which would be included with logging automatically. (may not be import with OTLP tracing.)
  • json logging

About

A straightforward logging utility library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages