Skip to content

Commit

Permalink
Merge pull request #395 from radical-cybertools/fix/issue_394
Browse files Browse the repository at this point in the history
Disable reporter by default
  • Loading branch information
andre-merzky authored Nov 22, 2023
2 parents 5b5e2c3 + 3abcac6 commit c376a46
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/radical/utils/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Reporter(object):

# --------------------------------------------------------------------------
#
def __init__(self, name, ns=None, path=None, targets=None):
def __init__(self, name, ns=None, path=None, targets=None, enabled=None):
'''
settings.style:
E : empty line
Expand All @@ -106,16 +106,23 @@ def __init__(self, name, ns=None, path=None, targets=None):
ns = name

# check if this profile is enabled via an env variable
self._enabled = str(ru_def['report']).lower()
if ru_get_env_ns('report', ns) is not None:
self._enabled = str(ru_get_env_ns('report', ns)).lower()
if enabled is not None:
self._enabled = bool(enabled)
else:
self._enabled = str(ru_def['report']).lower()

if ru_get_env_ns('report', ns) is not None:
self._enabled = str(ru_get_env_ns('report', ns)).lower()

if self._enabled in ['0', 'false', 'off', 'none']:
self._enabled = False
else:
self._enabled = True

if self._enabled in ['0', 'false', 'off', False, None]:
self._enabled = False

if not self._enabled:
# disabled
return
else:
self._enabled = True


self._use_color = ru_get_env_ns('report_color', ns, default='True')
Expand Down

0 comments on commit c376a46

Please sign in to comment.