Skip to content

Commit

Permalink
refers to deep-compute#108 added conditions if env-file is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
rajinish01 committed Sep 26, 2021
1 parent d7ffb92 commit 0de7349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion basescript/basescript.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def __init__(self, args=None):
self._flush_metrics_q = log._force_flush_q
self.log = log.bind(name=self.args.name)

ReadEnv(self.args.env_file)
if self.args.env_file:
ReadEnv(self.args.env_file)

self.stats = Dummy()

Expand Down
3 changes: 2 additions & 1 deletion basescript/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def _add_base_info(self, event_dict):
f = sys._getframe()
level_method_frame = f.f_back
caller_frame = level_method_frame.f_back
event_dict.update(self.env_context)
if hasattr(self, "env_context"):
event_dict.update(self.env_context)
return event_dict

def debug(self, event=None, *args, **kw):
Expand Down

0 comments on commit 0de7349

Please sign in to comment.