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
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)
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
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.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.