mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Integrate review feedback
This commit is contained in:
parent
30615f425e
commit
20b3eca257
3 changed files with 46 additions and 16 deletions
|
@ -95,3 +95,28 @@ event Broker::error(code: ErrorCode, msg: string)
|
|||
Reporter::error(fmt("Broker error (%s): %s", code, msg));
|
||||
}
|
||||
|
||||
event Broker::internal_log_event(lvl: LogSeverityLevel, id: string, description: string)
|
||||
{
|
||||
local severity = Broker::CRITICAL_EVENT;
|
||||
switch lvl {
|
||||
case Broker::LOG_ERROR:
|
||||
severity = Broker::ERROR;
|
||||
break;
|
||||
case Broker::LOG_WARNING:
|
||||
severity = Broker::WARNING_EVENT;
|
||||
break;
|
||||
case Broker::LOG_INFO:
|
||||
severity = Broker::INFO_EVENT;
|
||||
break;
|
||||
case Broker::LOG_VERBOSE:
|
||||
severity = Broker::VERBOSE_EVENT;
|
||||
break;
|
||||
case Broker::LOG_DEBUG:
|
||||
severity = Broker::DEBUG_EVENT;
|
||||
break;
|
||||
}
|
||||
Log::write(Broker::LOG, [$ts = network_time(),
|
||||
$ty = severity,
|
||||
$ev = id,
|
||||
$message = description]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue