log

package
v0.74.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	LevelAll   = "all"
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
	LevelNone  = "none"
)
View Source
const (
	FormatLogFmt = "logfmt"
	FormatJSON   = "json"
)

Variables

View Source
var AvailableLogFormats = []string{
	FormatLogFmt,
	FormatJSON,
}

AvailableLogFormats is a list of supported log formats

AvailableLogLevels is a list of supported logging levels

Functions

func NewLogger

func NewLogger(c Config) (log.Logger, error)

NewLogger returns a log.Logger that prints in the provided format at the provided level with a UTC timestamp and the caller of the log entry.

func RegisterFlags added in v0.70.0

func RegisterFlags(fs *flag.FlagSet, c *Config)

Types

type Config added in v0.70.0

type Config struct {
	Level  string
	Format string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL