Skip to content

Commit

Permalink
MNT: Improve some logging calls
Browse files Browse the repository at this point in the history
Don't unconditionally do the string interpolation, but rather let
logging do it if it's enabled.
  • Loading branch information
dopplershift committed Nov 18, 2021
1 parent 3316bb6 commit fa1e927
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/siphon/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ def _get_handler(self, handler_name):
elif handler_name in self._sts:
return getattr(self._st, handler_name)
else:
msg = f'cannot find handler for element {handler_name}'
log.warning(msg)
log.warning('cannot find handler for element %s', handler_name)

def _parse_element(self, element):

Expand Down
3 changes: 1 addition & 2 deletions src/siphon/ncss_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ def lookup(self, handler_name):
if handler_name in dir(self):
return getattr(self, handler_name)
else:
msg = f'cannot find handler for element {handler_name}'
log.warning(msg)
log.warning('cannot find handler for element %s', handler_name)


class NCSSDataset:
Expand Down

0 comments on commit fa1e927

Please sign in to comment.