I'm currently working with the zerolog library in my Go application, and I'm facing a requirement where I need to differentiate the output of log messages based on their log level:
I want log messages of ERROR level to be displayed only in the terminal/console.
All log messages, regardless of their level (DEBUG, INFO, WARNING, ERROR), should be sent to a hook for further processing.
Is there a way to configure zerolog such that ERROR level log messages are shown only in the terminal while still allowing all log messages to be sent to the hook for further processing?
I'm currently working with the zerolog library in my Go application, and I'm facing a requirement where I need to differentiate the output of log messages based on their log level:
This is my Code :
Is there a way to configure zerolog such that ERROR level log messages are shown only in the terminal while still allowing all log messages to be sent to the hook for further processing?