Skip to content

Commit

Permalink
fix: Fixed DUMP_ENV logging level (claranet#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlinc authored Jun 16, 2020
1 parent baf9750 commit 61f8e87
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def formatMessage(self, record):
log.setLevel(logging.INFO)


def dump_env():
if log.isEnabledFor(DUMP_ENV):
log.debug('ENV: %s', json.dumps(dict(os.environ), indent=2))


################################################################################
# Backports

Expand Down Expand Up @@ -926,8 +931,7 @@ def prepare_command(args):
# Load the query.
query_data = json.load(sys.stdin)

if log.isEnabledFor(DUMP_ENV):
log.debug('ENV: %s', json.dumps(dict(os.environ), indent=2))
dump_env()
if log.isEnabledFor(DEBUG2):
if log.isEnabledFor(DEBUG3):
log.debug('QUERY: %s', json.dumps(query_data, indent=2))
Expand Down Expand Up @@ -1016,8 +1020,7 @@ def build_command(args):

log = logging.getLogger('build')

if log.isEnabledFor(DEBUG3):
log.debug('ENV: %s', json.dumps(dict(os.environ), indent=2))
dump_env()
if log.isEnabledFor(DEBUG2):
log.debug('CMD: python3 %s', shlex_join(sys.argv))

Expand Down

0 comments on commit 61f8e87

Please sign in to comment.