GH-1036: change print.log to log network time instead of current

This commit is contained in:
Jon Siwek 2020-06-26 19:55:09 -07:00
parent eb1a408b6a
commit 54d8954c80
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ export {
## If :zeek:see:`Log::print_to_log` is set to redirect, ``print`` statements will ## If :zeek:see:`Log::print_to_log` is set to redirect, ``print`` statements will
## automatically populate log entries with the fields contained in this record. ## automatically populate log entries with the fields contained in this record.
type PrintLogInfo: record { type PrintLogInfo: record {
## Current timestamp. ## The network time at which the print statement was executed.
ts: time &log; ts: time &log;
## Set of strings passed to the print statement. ## Set of strings passed to the print statement.
vals: string_vec &log; vals: string_vec &log;

View file

@ -215,7 +215,7 @@ static void print_log(const std::vector<IntrusivePtr<Val>>& vals)
vec->Assign(vec->Size(), make_intrusive<StringVal>(d.Description())); vec->Assign(vec->Size(), make_intrusive<StringVal>(d.Description()));
} }
record->Assign(0, make_intrusive<TimeVal>(current_time())); record->Assign(0, make_intrusive<TimeVal>(network_time));
record->Assign(1, std::move(vec)); record->Assign(1, std::move(vec));
log_mgr->Write(plval.get(), record.get()); log_mgr->Write(plval.get(), record.get());
} }