Skip to content

Commit

Permalink
Make build example able to skip timestamps in logs (#9298)
Browse files Browse the repository at this point in the history
* Make build example able to skip timestamps in logs, disable these timestamps in CI because github has the timesetamps option already available

* Fix typo

* Restyle fixes
  • Loading branch information
andy31415 authored Aug 28, 2021
1 parent b64ee77 commit f07ff95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
- name: Build android examples
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --platform android build"
"./scripts/build/build_examples.py --no-log-timestamps --platform android build"
2 changes: 1 addition & 1 deletion .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ jobs:
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh \
"scripts/build/build_examples.py --platform infineon --app lock build"
"scripts/build/build_examples.py --no-log-timestamps --platform infineon --app lock build"
14 changes: 10 additions & 4 deletions scripts/build/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,19 @@ def ValidateRepoPath(context, parameter, value):
default="-",
type=click.File("wt"),
help='Where to write the dry run output')
@click.option(
'--no-log-timestamps',
default=False,
is_flag=True,
help='Skip timestaps in log output')
@click.pass_context
def main(context, log_level, platform, board, app, repo, out_prefix, clean,
dry_run, dry_run_output, enable_flashbundle):
dry_run, dry_run_output, enable_flashbundle, no_log_timestamps):
# Ensures somewhat pretty logging of what is going on
coloredlogs.install(
level=__LOG_LEVELS__[log_level],
fmt='%(asctime)s %(name)s %(levelname)-7s %(message)s')
log_fmt = '%(asctime)s %(levelname)-7s %(message)s'
if no_log_timestamps:
log_fmt = '%(levelname)-7s %(message)s'
coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt)

if not 'PW_PROJECT_ROOT' in os.environ:
raise click.UsageError("""
Expand Down

0 comments on commit f07ff95

Please sign in to comment.