mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
cli: set up structlog config
This commit is contained in:
parent
b723ab6db5
commit
3cdefc0779
@ -112,6 +112,21 @@ def rethinker(args):
|
|||||||
|
|
||||||
|
|
||||||
def configure_logging(args):
|
def configure_logging(args):
|
||||||
|
structlog.configure(
|
||||||
|
processors=[
|
||||||
|
structlog.contextvars.merge_contextvars,
|
||||||
|
structlog.processors.add_log_level,
|
||||||
|
structlog.processors.StackInfoRenderer(),
|
||||||
|
structlog.dev.set_exc_info,
|
||||||
|
structlog.processors.TimeStamper(fmt="%Y-%m-%d %H:%M:%S", utc=False),
|
||||||
|
structlog.dev.ConsoleRenderer()
|
||||||
|
],
|
||||||
|
wrapper_class=structlog.make_filtering_bound_logger(args.log_level),
|
||||||
|
context_class=dict,
|
||||||
|
logger_factory=structlog.PrintLoggerFactory(),
|
||||||
|
cache_logger_on_first_use=False
|
||||||
|
)
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
stream=sys.stderr,
|
stream=sys.stderr,
|
||||||
level=args.log_level,
|
level=args.log_level,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user