mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Add error events to input framework.
This change introduces error events for Table and Event readers. Users can now specify an event that is called when an info, warning, or error is emitted by their input reader. This can, e.g., be used to raise notices in case errors occur when reading an important input stream. Example: event error_event(desc: Input::TableDescription, msg: string, level: Reporter::Level) { ... } event bro_init() { Input::add_table([$source="a", $error_ev=error_event, ...]); } For the moment, this converts all errors in the Asciiformatter into warnings (to show that they are non-fatal) - the Reader itself also has to throw an Error to show that a fatal error occurred and processing will be abort. It might be nicer to change this and require readers to mark fatal errors as such when throwing them. Addresses BIT-1181
This commit is contained in:
parent
697b59cdc8
commit
6b9abe85a7
29 changed files with 458 additions and 150 deletions
|
@ -1,8 +1,8 @@
|
|||
error: ../input.log/Input::READER_ASCII: Number '12129223372036854775800' out of supported range.
|
||||
error: ../input.log/Input::READER_ASCII: Could not convert line '12129223372036854775800 121218446744073709551612' to Val. Ignoring line.
|
||||
warning: ../input.log/Input::READER_ASCII: Number '12129223372036854775800' out of supported range.
|
||||
warning: ../input.log/Input::READER_ASCII: Could not convert line '12129223372036854775800 121218446744073709551612' to Val. Ignoring line.
|
||||
warning: ../input.log/Input::READER_ASCII: Number '9223372036854775801TEXTHERE' contained non-numeric trailing characters. Ignored trailing characters 'TEXTHERE'
|
||||
warning: ../input.log/Input::READER_ASCII: Number '1Justtext' contained non-numeric trailing characters. Ignored trailing characters 'Justtext'
|
||||
error: ../input.log/Input::READER_ASCII: String 'Justtext' contained no parseable number
|
||||
error: ../input.log/Input::READER_ASCII: Could not convert line 'Justtext 1' to Val. Ignoring line.
|
||||
warning: ../input.log/Input::READER_ASCII: String 'Justtext' contained no parseable number
|
||||
warning: ../input.log/Input::READER_ASCII: Could not convert line 'Justtext 1' to Val. Ignoring line.
|
||||
received termination signal
|
||||
>>>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue