mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Do not use scientific notations when printing doubles in logs.
Closes BIT-1558.
This commit is contained in:
parent
3581ead0d9
commit
d86bf15dbf
7 changed files with 197 additions and 5 deletions
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# @TEST-EXEC: bro -b %INPUT
|
||||
# @TEST-EXEC: btest-diff test.log
|
||||
#
|
||||
# Make sure we do not write out scientific notation for doubles.
|
||||
|
||||
module Test;
|
||||
|
||||
export {
|
||||
redef enum Log::ID += { LOG };
|
||||
|
||||
type Info: record {
|
||||
d: double &log;
|
||||
};
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Info]);
|
||||
Log::write(Test::LOG, [$d=2153226000.0]);
|
||||
Log::write(Test::LOG, [$d=2153226000.1]);
|
||||
Log::write(Test::LOG, [$d=2153226000.123456789]);
|
||||
Log::write(Test::LOG, [$d=1.0]);
|
||||
Log::write(Test::LOG, [$d=1.1]);
|
||||
Log::write(Test::LOG, [$d=1.123456789]);
|
||||
Log::write(Test::LOG, [$d=1.1234]);
|
||||
Log::write(Test::LOG, [$d=3.14e15]);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue