tools: Some additions to IDF Monitor's timestamps

Additions to https://github.com/espressif/esp-idf/pull/7021
This commit is contained in:
Roland Dobai
2021-05-27 16:14:55 +02:00
parent f91bde97c1
commit 483f51cdd0
5 changed files with 74 additions and 26 deletions

View File

@@ -71,7 +71,7 @@ def action_extensions(base_actions, project_path):
return result
def monitor(action, ctx, args, print_filter, monitor_baud, encrypted):
def monitor(action, ctx, args, print_filter, monitor_baud, encrypted, timestamps, timestamp_format):
"""
Run idf_monitor.py to watch build output
"""
@@ -118,6 +118,12 @@ def action_extensions(base_actions, project_path):
if encrypted:
monitor_args += ['--encrypted']
if timestamps:
monitor_args += ['--timestamps']
if timestamp_format:
monitor_args += ['--timestamp-format', timestamp_format]
idf_py = [PYTHON] + _get_commandline_options(ctx) # commands to re-run idf.py
monitor_args += ['-m', ' '.join("'%s'" % a for a in idf_py)]
@@ -214,7 +220,17 @@ def action_extensions(base_actions, project_path):
'IDF Monitor will invoke encrypted-flash and encrypted-app-flash targets '
'if this option is set. This option is set by default if IDF Monitor was invoked '
'together with encrypted-flash or encrypted-app-flash target.'),
}, {
'names': ['--timestamps'],
'is_flag': True,
'help': 'Print a time stamp in the beginning of each line.',
}, {
'names': ['--timestamp-format'],
'help': ('Set the formatting of timestamps compatible with strftime(). '
'For example, "%Y-%m-%d %H:%M:%S".'),
'default': None
}
],
'order_dependencies': [
'flash',