mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

Adjustments during merge: - kept the UNKNOWN Log::ID as placeholder value - changed the coverage.find-bro-logs test to check for arbitrary $path field values instead of just string literals - don't force EnumVal to unsigned integer since the relevant union member is the signed integer and added the relevant enum values/types to .bif files for easier access - compare FILE* versus file name to check for stdout equality (don't think it matters much, just a bit more efficient) - minor whitespace/style tweaks * origin/topic/dev/print-to-log: Added a non boolean configuration and other changes as suggested by Jon Allow Print Statements to be redirected to a Log# This is a combination of 3 commits.
25 lines
486 B
Text
25 lines
486 B
Text
#
|
|
# @TEST-EXEC: zeek -b %INPUT
|
|
# @TEST-EXEC: btest-diff print.log
|
|
# @TEST-EXEC: btest-diff .stdout
|
|
# @TEST-EXEC: btest-diff otherfile
|
|
# @TEST-EXEC: btest-diff anotherfile
|
|
|
|
redef Log::print_to_log = Log::REDIRECT_STDOUT;
|
|
|
|
event zeek_init()
|
|
{
|
|
local f = open("otherfile");
|
|
print f, "hello world ,";
|
|
print "hello world ,";
|
|
print f,2,T;
|
|
print 2,T;
|
|
close(f);
|
|
}
|
|
|
|
event Log::log_print (rec: Log::PrintLogInfo)
|
|
{
|
|
local f = open("anotherfile");
|
|
print f,"from event",rec;
|
|
close(f);
|
|
}
|