Skip to content

Commit

Permalink
Merge branch 'fix/auto-color-timestamp' into 'master'
Browse files Browse the repository at this point in the history
fix: Auto color for alternative timestamp formats

Closes IDFGH-14376

See merge request espressif/esp-idf-monitor!78
  • Loading branch information
peterdragun committed Jan 14, 2025
2 parents cea7d79 + 25d3b95 commit 444fb2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion esp_idf_monitor/base/output_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ANSI_YELLOW_B = ANSI_YELLOW.encode()
ANSI_NORMAL_B = ANSI_NORMAL.encode()

AUTO_COLOR_REGEX = re.compile(rb'^(I|W|E) \(\d+\)')
AUTO_COLOR_REGEX = re.compile(rb'^(I|W|E) \([\d:\. -]+\)')

COMMON_PREFIX = '---'

Expand Down
4 changes: 4 additions & 0 deletions test/host_test/inputs/color.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ D (120) debug: Debug message
I (578) main_task: Started on CPU0
W (470) spi_flash: Detected size(4096k)
E (623) foo: This is an example error
I (00:00:00.100) bar: This is an example with system time
I (20-02-02 00:00:00.100) baz: This is an example with system datetime
Hello world!
Already colored
I (578) main_task: Started on CPU0
W (470) spi_flash: Detected size(4096k)
E (623) foo: This is an example error
I (00:00:00.100) bar: This is an example with system time
I (20-02-02 00:00:00.100) baz: This is an example with system datetime
4 changes: 4 additions & 0 deletions test/host_test/inputs/color_out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ D (120) debug: Debug message
I (578) main_task: Started on CPU0
W (470) spi_flash: Detected size(4096k)
E (623) foo: This is an example error
I (00:00:00.100) bar: This is an example with system time
I (20-02-02 00:00:00.100) baz: This is an example with system datetime
Hello world!
Already colored
I (578) main_task: Started on CPU0
W (470) spi_flash: Detected size(4096k)
E (623) foo: This is an example error
I (00:00:00.100) bar: This is an example with system time
I (20-02-02 00:00:00.100) baz: This is an example with system datetime

0 comments on commit 444fb2b

Please sign in to comment.