Skip to content

Commit

Permalink
Make root log level configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Mar 15, 2021
1 parent b7ae64b commit e66abec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ inputs:
check_run_annotations_branch:
description: 'Adds check run annotations only on given branches. If not given, this defaults to the default branch of your repository, e.g. main or master. Comma separated list of branch names allowed, asterisk "*" matches all branches.'
required: false
log_level:
description: 'Action logging level'
required: false
default: 'INFO'
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
4 changes: 3 additions & 1 deletion publish_unit_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ def get_settings(options: dict) -> Settings:
if __name__ == "__main__":
options = dict(os.environ)

logging.root.level = logging.INFO
root_log_level = get_var('ROOT_LOG_LEVEL', options) or 'INFO'
logging.root.level = logging.getLevelName(root_log_level)
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)5s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S %z')

log_level = get_var('LOG_LEVEL', options) or 'INFO'
logger.level = logging.getLevelName(log_level)
github_action.logger.level = logging.getLevelName(log_level)
Expand Down

0 comments on commit e66abec

Please sign in to comment.