mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-07-24 07:20:53 -04:00
cli: set up structlog config
This commit is contained in:
parent
b723ab6db5
commit
3cdefc0779
1 changed files with 15 additions and 0 deletions
|
@ -112,6 +112,21 @@ def rethinker(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(
|
||||
stream=sys.stderr,
|
||||
level=args.log_level,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue