Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StdLogBackend ¶
type StdLogBackend struct {
log.CommonBackend
// Formatter generates the final string printed to stdlog.
Formatter func(entry log.Entry, cfg log.BackendConfig, senderSpacing int, severitySpacing int) string
// contains filtered or unexported fields
}
StdLogBackend writes entries to the standard library logger. Prefer configuring stdlog with SetFlags(0) for consistent output.
func (*StdLogBackend) NotifyAboutSender ¶
func (loggy *StdLogBackend) NotifyAboutSender(sender string)
NotifyAboutSender tracks the widest sender name for padding.
func (*StdLogBackend) NotifyAboutSeverity ¶
func (loggy *StdLogBackend) NotifyAboutSeverity(severity *log.Severity)
NotifyAboutSeverity tracks the widest severity label for padding.
func (*StdLogBackend) Shutdown ¶
func (loggy *StdLogBackend) Shutdown()
Shutdown satisfies the Backend interface but stdlog has nothing to release.
func (*StdLogBackend) Write ¶
func (loggy *StdLogBackend) Write(entry log.Entry) error
Write formats the entry and outputs it when it meets the gate.
Source Files
¶
- Backend.go
- Compliance.go
Click to show internal directories.
Click to hide internal directories.