Documentation ¶
Overview ¶
relog provides an alternate logger api with support for logging levels. Although flexible, the recommended usage is to create a logger object, set it as the global logger and use the package level functions to execute the logging. Multiple logger objects are only meant for those who like trouble.
Index ¶
- Constants
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func HijackLog(rl *Logger)
- func HijackStdio(fOut *os.File, fErr *os.File) error
- func Info(format string, args ...interface{})
- func LogNameToLogLevel(name string) (int, error)
- func Redact(s string) string
- func SetFlags(flags int)
- func SetLevel(level int)
- func SetLevelByName(name string) error
- func SetOutput(w io.Writer)
- func SetPrefix(prefix string)
- func Warning(format string, args ...interface{})
- type Logger
- func (logger *Logger) Debug(format string, args ...interface{})
- func (logger *Logger) Error(format string, args ...interface{})
- func (logger *Logger) Fatal(format string, args ...interface{})
- func (logger *Logger) Info(format string, args ...interface{})
- func (logger *Logger) Prefix() string
- func (logger *Logger) SetFlags(flags int)
- func (logger *Logger) SetLevel(level int)
- func (logger *Logger) SetPrefix(prefix string)
- func (logger *Logger) Warning(format string, args ...interface{})
- type Redactor
Constants ¶
View Source
const ( DEBUG = iota INFO WARNING ERROR LOG // Level to indicate line was output by the Go logging system. FATAL )
View Source
const ( Ltsv = 1 << iota // guarantee a single line of tab-separated values Lblob // include JSON enoded annotations Lstdflags = 0 )
Variables ¶
This section is empty.
Functions ¶
func HijackLog ¶
func HijackLog(rl *Logger)
Place a shim in the default log package to route messages to a single file. If rl is nil, use the standard relog instance.
func HijackStdio ¶
Replace stdout and stderr with a file. This overwrites the actual file descriptors which means even top level panic output will show up in these files.
func LogNameToLogLevel ¶
func SetLevelByName ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.