Lifeomic-logging

Latest version: v0.4.0

Safety actively analyzes 688896 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.4.0

Added

- Added a new `JsonLogger` class that logs messages in JSON format. Supports
child loggers as well. The logger inherits from builtin `logging.Logger` and
the log methods have the same API as the builtin as well. Example usage:

python
from lifeomic_logging import JsonLogger

Create a logger with a name and optional context that will be included
on all log messages.
logger = JsonLogger("my-logger", {"foo": "bar"})
logger.info({"msg": "message", "isTrue": True})
>>> {"name": "my-logger", "foo": "bar", "level": "INFO", "msg": "message", "isTrue": true}
child_logger = logger.child({"fizz": "buzz"})
child.info("message")
>>> {"name": "my-logger", "foo": "bar", "fizz": "buzz", "level": "INFO", "msg": "message"}

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.