Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ZeroLogBackend ¶
type ZeroLogBackend struct {
log.CommonBackend
// contains filtered or unexported fields
}
ZeroLogBackend writes log entries as structured JSON using rs/zerolog. It respects the CommonBackend gate and emits the following fields: - time (from Entry.Timestamp()) - sender - severity - severity_index - message (standard zerolog message field)
func New ¶
func New(writer io.Writer) *ZeroLogBackend
New creates a new ZeroLogBackend. If writer is nil, os.Stderr is used.
func (*ZeroLogBackend) NotifyAboutSender ¶
func (z *ZeroLogBackend) NotifyAboutSender(sender string)
NotifyAboutSender is a no-op for structured logs but required by the interface.
func (*ZeroLogBackend) NotifyAboutSeverity ¶
func (z *ZeroLogBackend) NotifyAboutSeverity(severity *log.Severity)
NotifyAboutSeverity is a no-op for structured logs but required by the interface.
func (*ZeroLogBackend) Shutdown ¶
func (z *ZeroLogBackend) Shutdown()
Shutdown implements Backend but no cleanup is necessary.
func (*ZeroLogBackend) Write ¶
func (z *ZeroLogBackend) Write(entry log.Entry) error
Write emits the entry to the configured writer using zerolog.
Source Files
¶
- Backend.go
Click to show internal directories.
Click to hide internal directories.