Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from cirrus-geo/fix-exception-logging
Browse files Browse the repository at this point in the history
Fix exception traceback logging
  • Loading branch information
jkeifer authored Dec 14, 2021
2 parents 784456d + 3d0079c commit e57aa64
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cirruslib/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ def __init__(self, *args, keys=None, **kwargs):

def process(self, msg, kwargs):
if self.keys is not None:
kwargs = {k: self.extra[k] for k in self.keys if k in self.extra}
return (msg, {"extra": kwargs})
else:
return (msg, kwargs)
kwargs['extra'] = {
k: self.extra[k]
for k in self.keys
if k in self.extra
}
return (msg, kwargs)


def get_task_logger(*args, catalog, **kwargs):
_logger = logging.getLogger(*args, **kwargs)
logger = DynamicLoggerAdapter(_logger, catalog, keys=['id', 'stac_version'])
return logger

0 comments on commit e57aa64

Please sign in to comment.