With this change, the user may specify a verboseEvents
boolean option when creating a logger. If true, the logger
will include the buffer of messages that was sent (or attempted
to be sent) when emitting send and error events, in the
buffer member of the send event and the meta.buffer member
of the error event. This enables users to correctly identify
the messages that were transmitted for metrics in case of success,
and to implement higher-level retry behaviors in case of errors.
lib/logger.js: Add support for verboseEvents option.
(send): When emitting send and error events, include the
message buffer involved when verboseEvents is true. In case
of partial success, each error event will include a buffer
containing only the specific line that failed; and the corresponding
send event will include a buffer containing only those lines that
were sent successfully.
With this change, the user may specify a
verboseEvents
boolean option when creating a logger. If true, the logger will include the buffer of messages that was sent (or attempted to be sent) when emittingsend
anderror
events, in thebuffer
member of thesend
event and themeta.buffer
member of theerror
event. This enables users to correctly identify the messages that were transmitted for metrics in case of success, and to implement higher-level retry behaviors in case of errors.lib/logger.js: Add support for
verboseEvents
option. (send): When emittingsend
anderror
events, include the message buffer involved whenverboseEvents
is true. In case of partial success, eacherror
event will include a buffer containing only the specific line that failed; and the correspondingsend
event will include a buffer containing only those lines that were sent successfully.test/common/create-options.js:
test/logger-errors.js:
test/logger-instantiation.js:
test/logger-log.js: Add tests for
verboseEvents
.README.md:
types.d.ts: Update readme and type definitions.
Fixes: #60