mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
broker: Include log event identifier in stderr output
This commit is contained in:
parent
ba5dcb1d84
commit
6c44bfa3fb
1 changed files with 5 additions and 2 deletions
|
@ -1167,8 +1167,11 @@ void Manager::ProcessLogEvents() {
|
||||||
event_mgr.Enqueue(::Broker::internal_log_event, std::move(args));
|
event_mgr.Enqueue(::Broker::internal_log_event, std::move(args));
|
||||||
}
|
}
|
||||||
if ( bstate->stderrSeverity >= severity ) {
|
if ( bstate->stderrSeverity >= severity ) {
|
||||||
fprintf(stderr, "[BROKER/%s] %s\n", severity_names_tbl[static_cast<int>(severity)],
|
// Formatting the event->identifier string_view using "%.*s" - the explicit
|
||||||
event->description.c_str());
|
// precision ".*" allows specifying the length of the following char* argument
|
||||||
|
// as string_views in general are not guaranteed to be null terminated.
|
||||||
|
fprintf(stderr, "[BROKER/%s] %.*s: %s\n", severity_names_tbl[static_cast<int>(severity)],
|
||||||
|
static_cast<int>(event->identifier.size()), event->identifier.data(), event->description.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue