Skip to content

Ohad31415/py-basic-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic-logging

This tiny utility presents a handy console logging configuration having:

  • Microsecond timestamp.
  • Tz-aware (utc by default) datetime.
  • Json (by default) serialized logs.

The logger's time format can be any valid python datetime's one, by default - %Y-%m-%d %H:%M:%S.%f%z (i.e "2021-09-23 15:44:22.379953+0000").

🎮 Usage

All boils down to one function - configure_logging, see its docstring for documentation.
This function only configures console which by most this is what cloud run programs or similar need but can be used as a based and be added more handlers (file, mail, ...) via the extra or manually.

🧪 Tests

From this project's directory -

$ pytest -v --doctest-modules .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages