Commit Graph

7 Commits

Author SHA1 Message Date
Edward McFarlane 78448ee023
New TestWriter for logging to testing.TB (#369) 2021-10-05 01:07:40 +02:00
Nuno Diegues a8f5328bb7
Make MultiLevelWriter resilient to individual log failure (#282)
Fixes #281

Currently MultiLevelWriter would give up if any individual backing logger
failed. This could result in no logging ever happening if the bad logger
was set up in the first position.

As a motivating factor, this can happen in "normal" circumstances, such
as running as a Windows Service where stderr is not available and therefore
the ConsoleWriter will fail. If you happen to set it as the first logger,
then no logging ever takes place. To make matters worse, connecting a
debugger creates an stderr, so it made it a pretty daunting situation
to overcome.

The proposed solution is to go through all underlying loggers and return
the last error obtained, if any. In practice there isn't much being done
with those errors anyway, as the best way to address logging errors is
to hook a ErrorHandler, which will still be triggered despite this change.

Co-authored-by: Nuno Diegues <nuno@cloudflare.com>
2021-01-20 17:03:52 +01:00
Ravi Raju ddfae1b613 Binary format support (#37)
Adds support for binary logging (with cbor encoding) in addition to JSON. Use the binary_log compile tag to enable the feature.
2018-03-28 11:49:41 -07:00
Rodrigo Coelho c3d02683c7 Add hook support (#24) 2017-12-01 10:52:37 -07:00
Rodrigo Coelho c8e50a6043 Fix tests for Windows. (#23) 2017-11-27 10:01:32 -08:00
Olivier Poitrey 2a829377cb Rename warning field to warn in the output 2017-06-08 10:03:03 -07:00
Olivier Poitrey ded037b89a Remove syslog dep and write some more tests 2017-05-15 14:36:49 -07:00