package capnslog

Import Path
	github.com/coreos/pkg/capnslog (on go.dev)

Dependency Relation
	imports 16 packages, and imported by one package


Package-Level Type Names (total 9)
/* sort by: | */
( Formatter) Flush() ( Formatter) Format(pkg string, level LogLevel, depth int, entries ...interface{}) *GlogFormatter *LogFormatter *NilFormatter *PrettyFormatter *StringFormatter Formatter : net/http.Flusher func NewDefaultFormatter(out io.Writer) Formatter func NewDefaultSyslogFormatter(tag string) (Formatter, error) func NewJournaldFormatter() (Formatter, error) func NewLogFormatter(w io.Writer, prefix string, flag int) Formatter func NewNilFormatter() Formatter func NewPrettyFormatter(w io.Writer, debug bool) Formatter func NewStringFormatter(w io.Writer) Formatter func NewSyslogFormatter(w *syslog.Writer) Formatter func SetFormatter(f Formatter)
StringFormatter StringFormatter (*GlogFormatter) Flush() ( GlogFormatter) Format(pkg string, level LogLevel, depth int, entries ...interface{}) *GlogFormatter : Formatter *GlogFormatter : net/http.Flusher func NewGlogFormatter(w io.Writer) *GlogFormatter
LogFormatter emulates the form of the traditional built-in logger. Flush is included so that the interface is complete, but is a no-op. Format builds a log message for the LogFormatter. The LogLevel is ignored. *LogFormatter : Formatter *LogFormatter : net/http.Flusher
LogLevel is the set of all log levels. Char returns a single-character representation of the log level. Update using the given string value. Fulfills the flag.Value interface. String returns a multi-character representation of the log level. Returns an empty string, only here to fulfill the pflag.Value interface. *LogLevel : github.com/spf13/pflag.Value LogLevel : expvar.Var *LogLevel : flag.Value LogLevel : fmt.Stringer func ParseLevel(s string) (LogLevel, error) func RepoLogger.ParseLogLevelConfig(conf string) (map[string]LogLevel, error) func GlogHeader(level LogLevel, depth int) []byte func SetGlobalLogLevel(l LogLevel) func Formatter.Format(pkg string, level LogLevel, depth int, entries ...interface{}) func GlogFormatter.Format(pkg string, level LogLevel, depth int, entries ...interface{}) func (*LogFormatter).Format(pkg string, _ LogLevel, _ int, entries ...interface{}) func (*NilFormatter).Format(_ string, _ LogLevel, _ int, _ ...interface{}) func (*PackageLogger).LevelAt(l LogLevel) bool func (*PackageLogger).Log(l LogLevel, args ...interface{}) func (*PackageLogger).Logf(l LogLevel, format string, args ...interface{}) func (*PackageLogger).SetLevel(l LogLevel) func (*PrettyFormatter).Format(pkg string, l LogLevel, depth int, entries ...interface{}) func RepoLogger.SetLogLevel(m map[string]LogLevel) func RepoLogger.SetRepoLogLevel(l LogLevel) func (*StringFormatter).Format(pkg string, l LogLevel, i int, entries ...interface{}) const CRITICAL const DEBUG const ERROR const INFO const NOTICE const TRACE const WARNING
NilFormatter is a no-op log formatter that does nothing. Flush is included so that the interface is complete, but is a no-op. Format does nothing. *NilFormatter : Formatter *NilFormatter : net/http.Flusher
(*PackageLogger) Debug(entries ...interface{}) (*PackageLogger) Debugf(format string, args ...interface{}) (*PackageLogger) Error(entries ...interface{}) (*PackageLogger) Errorf(format string, args ...interface{}) (*PackageLogger) Fatal(args ...interface{}) (*PackageLogger) Fatalf(format string, args ...interface{}) (*PackageLogger) Fatalln(args ...interface{}) (*PackageLogger) Flush() (*PackageLogger) Info(entries ...interface{}) (*PackageLogger) Infof(format string, args ...interface{}) LevelAt checks if the given log level will be outputted under current setting. Log a message at any level between ERROR and TRACE Log a formatted string at any level between ERROR and TRACE (*PackageLogger) Notice(entries ...interface{}) (*PackageLogger) Noticef(format string, args ...interface{}) (*PackageLogger) Panic(args ...interface{}) (*PackageLogger) Panicf(format string, args ...interface{}) (*PackageLogger) Panicln(args ...interface{}) (*PackageLogger) Print(args ...interface{}) (*PackageLogger) Printf(format string, args ...interface{}) (*PackageLogger) Println(args ...interface{}) SetLevel allows users to change the current logging level. (*PackageLogger) Trace(entries ...interface{}) (*PackageLogger) Tracef(format string, args ...interface{}) (*PackageLogger) Warning(entries ...interface{}) (*PackageLogger) Warningf(format string, args ...interface{}) *PackageLogger : github.com/go-sql-driver/mysql.Logger *PackageLogger : github.com/stretchr/testify/assert.TestingT *PackageLogger : go.uber.org/fx.Printer *PackageLogger : google.golang.org/grpc/grpclog.Logger *PackageLogger : google.golang.org/grpc/grpclog/internal.Logger *PackageLogger : gorm.io/gorm/logger.Writer *PackageLogger : net/http.Flusher func NewPackageLogger(repo string, pkg string) (p *PackageLogger)
(*PrettyFormatter) Flush() (*PrettyFormatter) Format(pkg string, l LogLevel, depth int, entries ...interface{}) *PrettyFormatter : Formatter *PrettyFormatter : net/http.Flusher
ParseLogLevelConfig parses a comma-separated string of "package=loglevel", in order, and returns a map of the results, for use in SetLogLevel. SetLogLevel takes a map of package names within a repository to their desired loglevel, and sets the levels appropriately. Unknown packages are ignored. "*" is a special package name that corresponds to all packages, and will be processed first. SetRepoLogLevel sets the log level for all packages in the repository. func GetRepoLogger(repo string) (RepoLogger, error) func MustRepoLogger(repo string) RepoLogger
(*StringFormatter) Flush() (*StringFormatter) Format(pkg string, l LogLevel, i int, entries ...interface{}) *StringFormatter : Formatter *StringFormatter : net/http.Flusher
Package-Level Functions (total 16)
GetRepoLogger may return the handle to the repository's set of packages' loggers.
func GlogHeader(level LogLevel, depth int) []byte
MustRepoLogger returns the handle to the repository's packages' loggers.
NewLogFormatter is a helper to produce a new LogFormatter struct. It uses the golang log package to actually do the logging work so that logs look similar.
NewNilFormatter is a helper to produce a new LogFormatter struct. It logs no messages so that you can cause part of your logging to be silent.
NewPackageLogger creates a package logger object. This should be defined as a global var in your package, referencing your repo.
ParseLevel translates some potential loglevel strings into their corresponding levels.
SetFormatter sets the formatting function for all logs.
SetGlobalLogLevel sets the log level for all packages in all repositories registered with capnslog.
Package-Level Constants (total 7)
CRITICAL is the lowest log level; only errors which will end the program will be propagated.
DEBUG is the default hidden level for more verbose updates about internal processes.
ERROR is for errors that are not fatal but lead to troubling behavior.
INFO is a log level for common, everyday log updates.
NOTICE is for normal but significant conditions.
TRACE is for (potentially) call by call tracing of programs.
WARNING is for errors which are not fatal and not errors, but are unusual. Often sourced from misconfigurations.