Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ComponentKey names the part of a program that emitted a log line. ComponentKey = "cmp" // ServiceNameKey distinguishes programs that write to the shared log file. ServiceNameKey = "service_name" // ServiceNameCLI identifies the hive CLI. ServiceNameCLI = "hive-cli" // ServiceNameDesktop identifies Hive Desktop. ServiceNameDesktop = "hive-desktop" )
View Source
const ( DefaultMaxFileSize = 10 << 20 DefaultFileBackups = 3 )
Variables ¶
This section is empty.
Functions ¶
func Component ¶ added in v0.60.0
Component returns logger with the component label set to name. Give it a logger that has no component label yet: zerolog appends fields, so a second call adds a second cmp key instead of replacing the first.
Types ¶
type Options ¶ added in v0.62.0
type Options struct {
Service string
Level zerolog.Level
File string
Console io.Writer
// JSON writers must not block.
JSON []io.Writer
Hooks []zerolog.Hook
// Zero means DefaultMaxFileSize and DefaultFileBackups; a negative
// FileBackups truncates the file instead of keeping a backup.
MaxFileSize int64
FileBackups int
}
Click to show internal directories.
Click to hide internal directories.