Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/log_format_impls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class generic_log_format : public log_format {
static const pcre_format log_fmt[] = {
pcre_format(R"(^(?:\*\*\*\s+)?(?<timestamp>@[0-9a-zA-Z]{16,24}))"),
pcre_format(
R"(^(?:\*\*\*\s+)?(?<timestamp>(?:\s|\d{4}[\-\/]\d{2}[\-\/]\d{2}|T|\d{1,2}:\d{2}(?::\d{2}(?:[\.,]\d{1,6})?)?|Z|[+\-]\d{2}:?\d{2}|(?!DBG|DEBUG|ERR|INFO|WARN|NONE)[A-Z]{3,4})+)[:|\s]?(trc|trace|dbg|debug|info|warn(?:ing)?|err(?:or)?)[:|\s]\s*)"),
R"(^(?:\*\*\*\s+)?(?<timestamp>(?:\s|\d{4}[\-\/]\d{2}[\-\/]\d{2}|T|\d{1,2}:\d{2}(?::\d{2}(?:[\.,]\d{1,9})?)?|Z|[+\-]\d{2}:?\d{2}|(?!DBG|DEBUG|ERR|INFO|WARN|NONE)[A-Z]{3,4})+)[:|\s]?(trc|trace|dbg|debug|info|warn(?:ing)?|err(?:or)?)[:|\s]\s*)"),
pcre_format(
R"(^(?:\*\*\*\s+)?(?<timestamp>[\w:+ \.,+/-]+) \[(trace|debug|info|warn(?:ing)?|error|critical)\]\s+)"),
pcre_format(
Expand Down
1 change: 1 addition & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ dist_noinst_DATA = \
logfile_generic.1 \
logfile_generic.2 \
logfile_generic.3 \
logfile_generic_nanos.0 \
logfile_generic_with_header.0 \
logfile_glog.0 \
logfile_grafana.0 \
Expand Down
2 changes: 2 additions & 0 deletions test/logfile_generic_nanos.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2025-01-01 00:00:00.123456789:INFO:nano first
2025-01-01 01:00:00.987654321:WARN:nano second
7 changes: 7 additions & 0 deletions test/test_logfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ Jul 02 10:22:40 2012 -- 672
Oct 08 16:56:38 2014 -- 344
EOF

run_test ./drive_logfile -t -f generic_log ${srcdir}/logfile_generic_nanos.0

check_output "generic_log nanosecond timestamp not parsed?" <<EOF
Jan 01 00:00:00 2025 -- 123
Jan 01 01:00:00 2025 -- 987
EOF

run_test ./drive_logfile -v -f generic_log ${srcdir}/logfile_generic.0

check_output "generic_log level interpreted incorrectly?" <<EOF
Expand Down
Loading