Skip to content

Commit

Permalink
fix: Fix make_exception
Browse files Browse the repository at this point in the history
  • Loading branch information
thulio committed Jan 9, 2019
1 parent ce38ee9 commit f19221a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions google_cloud_logger/__init__.py
Expand Up @@ -19,8 +19,9 @@ def __init__(self, *args, **kwargs):
def _get_extra_fields(self, record):
if hasattr(record, "extra"):
return record.extra
attributes = (field for field in record.__dict__.keys()
if not inspect.ismethod(field))
attributes = (
field for field in record.__dict__.keys() if not inspect.ismethod(field)
)

fields = set(attributes).difference(set(self.reserved_attrs.keys()))
return {key: getattr(record, key) for key in fields if key}
Expand Down Expand Up @@ -72,7 +73,7 @@ def make_exception(self, record):
}

def make_metadata(self, record):
if hasattr(record, "exc_info"):
if record.exc_info:
return {
"userLabels": self.make_user_labels(record),
"exception": self.make_exception(record),
Expand Down

0 comments on commit f19221a

Please sign in to comment.