ominfra 0.0.0.dev118__py3-none-any.whl → 0.0.0.dev119__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -437,7 +437,7 @@ class StandardLogFormatter(logging.Formatter):
437
437
  if datefmt:
438
438
  return ct.strftime(datefmt) # noqa
439
439
  else:
440
- t = ct.strftime("%Y-%m-%d %H:%M:%S") # noqa
440
+ t = ct.strftime('%Y-%m-%d %H:%M:%S')
441
441
  return '%s.%03d' % (t, record.msecs)
442
442
 
443
443
 
@@ -574,6 +574,7 @@ def configure_standard_logging(
574
574
  json: bool = False,
575
575
  target: ta.Optional[logging.Logger] = None,
576
576
  force: bool = False,
577
+ handler_factory: ta.Optional[ta.Callable[[], logging.Handler]] = None,
577
578
  ) -> ta.Optional[StandardLogHandler]:
578
579
  with _locking_logging_module_lock():
579
580
  if target is None:
@@ -587,7 +588,10 @@ def configure_standard_logging(
587
588
 
588
589
  #
589
590
 
590
- handler = logging.StreamHandler()
591
+ if handler_factory is not None:
592
+ handler = handler_factory()
593
+ else:
594
+ handler = logging.StreamHandler()
591
595
 
592
596
  #
593
597