diff options
| author | Elizabeth Hunt <elizabeth@simponic.xyz> | 2024-08-07 19:46:46 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth@simponic.xyz> | 2024-08-07 19:46:46 -0700 |
| commit | 6f03348e5aac33118840324a96e9321dca483b9f (patch) | |
| tree | a40d550cefce75bc882c506d5ead80e39228a990 /kennel/__init__.py | |
| download | kennel.hatecomputers.club-6f03348e5aac33118840324a96e9321dca483b9f.tar.gz kennel.hatecomputers.club-6f03348e5aac33118840324a96e9321dca483b9f.zip | |
initial commit that i did NOT steal from anywhere
Diffstat (limited to 'kennel/__init__.py')
| -rw-r--r-- | kennel/__init__.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kennel/__init__.py b/kennel/__init__.py new file mode 100644 index 0000000..ac7ac5e --- /dev/null +++ b/kennel/__init__.py @@ -0,0 +1,24 @@ +import logging +import sys + +import structlog + +log = structlog.get_logger() + +# Disable uvicorn logging +logging.getLogger("uvicorn.error").disabled = True +logging.getLogger("uvicorn.access").disabled = True + +# Structlog configuration +logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.INFO) +structlog.configure( + processors=[ + structlog.contextvars.merge_contextvars, + structlog.processors.add_log_level, + structlog.processors.StackInfoRenderer(), + structlog.dev.set_exc_info, + structlog.processors.TimeStamper(fmt="iso", utc=True), + structlog.dev.ConsoleRenderer(), + ], + logger_factory=structlog.PrintLoggerFactory(), +) |
