mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Adding a peer name to the communication logs.
This commit is contained in:
parent
be65acec4e
commit
e4052aba3d
1 changed files with 5 additions and 3 deletions
|
@ -19,7 +19,7 @@ export {
|
||||||
ts: time &log;
|
ts: time &log;
|
||||||
level: string &log &optional;
|
level: string &log &optional;
|
||||||
src_name: string &log &optional;
|
src_name: string &log &optional;
|
||||||
remote_node: string &log &optional;
|
peer: string &log &optional;
|
||||||
msg: string &log;
|
msg: string &log;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ function do_script_log_common(level: count, src: count, msg: string)
|
||||||
Log::write(COMMUNICATION, [$ts = network_time(),
|
Log::write(COMMUNICATION, [$ts = network_time(),
|
||||||
$level = (level == REMOTE_LOG_INFO ? "info" : "error"),
|
$level = (level == REMOTE_LOG_INFO ? "info" : "error"),
|
||||||
$src_name = src_names[src],
|
$src_name = src_names[src],
|
||||||
|
$peer = get_event_peer()$descr,
|
||||||
$msg = msg]);
|
$msg = msg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +143,7 @@ function connect_peer(peer: string)
|
||||||
|
|
||||||
if ( id == PEER_ID_NONE )
|
if ( id == PEER_ID_NONE )
|
||||||
Log::write(COMMUNICATION, [$ts = network_time(),
|
Log::write(COMMUNICATION, [$ts = network_time(),
|
||||||
$remote_node = fmt("%s:%d", node$host, p),
|
$peer = get_event_peer()$descr,
|
||||||
$msg = "can't trigger connect"]);
|
$msg = "can't trigger connect"]);
|
||||||
pending_peers[id] = node;
|
pending_peers[id] = node;
|
||||||
}
|
}
|
||||||
|
@ -270,6 +271,7 @@ event remote_state_inconsistency(operation: string, id: string,
|
||||||
local msg = fmt("state inconsistency: %s should be %s but is %s before %s",
|
local msg = fmt("state inconsistency: %s should be %s but is %s before %s",
|
||||||
id, expected_old, real_old, operation);
|
id, expected_old, real_old, operation);
|
||||||
Log::write(COMMUNICATION, [$ts = network_time(),
|
Log::write(COMMUNICATION, [$ts = network_time(),
|
||||||
|
$peer = get_event_peer()$descr,
|
||||||
$msg = msg]);
|
$msg = msg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue