This function will be called for every enabled log message.
It can be sync or async:
.then
).
If the promise rejects the logger will write an error message to stderr and stop functioning.
If the promise resolves the driver proceeds to the next log message (or waits for new ones to occur).Tips:
write
function that never rejects.
Instead handle logging errors as necessary to your use case and make the write function a noop, until it can be recovered.
A custom destination for structured logging messages.