ecs-logging-python
ecs-logging-python copied to clipboard
Similar to how structlog provides `.bind()` we could provide a context manager that adds extras so you don't have to include them every time you call `.info()`, etc.
```python LOGGING_CONFIG = { "format": "[%(asctime)s.%(msecs)03d] %(levelname)s %(name)s:%(funcName)s: %(message)s", "datefmt": "%d/%b/%Y:%H:%M:%S", }, + "ecs": { + "()": "ecs_logging.StdlibFormatter" + }, "access": {"format": "%(message)s",}, }, "handlers": { "default": { "class": "logging.StreamHandler",...
## Details ⚠️ This PR was created by an automated tool. Please review the changes carefully. ⚠️ Explicitly explain what GitHub commands are supported. ## Why We want to improve...
This PR caches and exposes the `extractors` dict for two purposes: - Loads the dict only during initialization, instead of on every logger invocation. - Provides a clearer and more...
after commit 7cdfcf95f9a335a17a7c2039cdd642177a81eb49 you support py13, its time for new release?
This changes the function signature of `StructlogProcessor.__call__` so that's it's compatible with structlog.typing.Processor. I've also removed the need for mypy to be run with `--no-warn-unused-ignores`. The test was requiring this...
When typechecking the following code: ```python from structlog.typing import Processor shared_processors: tuple[Processor, ...] = ( structlog.contextvars.merge_contextvars, structlog.processors.add_log_level, structlog.processors.StackInfoRenderer(), structlog.dev.set_exc_info, structlog.processors.TimeStamper(fmt="iso", utc=True), ) processors: list[Processor] if sys.stderr.isatty(): processors = [ *shared_processors,...