Documentation
¶
Index ¶
- Constants
- func AppendPassphraseRegexp(re ...any) error
- func Debug(msg ...any)
- func Debugf(format string, msg ...any)
- func DontHideToken()
- func Error(msg ...any)
- func Errorf(format string, msg ...any)
- func Fatal(msg ...any)
- func Fatalf(format string, msg ...any)
- func Info(msg ...any)
- func Infof(format string, msg ...any)
- func Log(msg ...any)
- func Logf(format string, msg ...any)
- func SetLogLevel(level int)
- func SetOutput(w io.Writer, index ...int)
- func SetPrefix(prefix string)
- func StderrTo(w io.Writer)
- func StdoutTo(w io.Writer)
- func Trace(msg ...any)
- func Tracef(format string, msg ...any)
- func Warn(msg ...any)
- func Warnf(format string, msg ...any)
- type LogC
- func (lc *LogC) AppendPassphraseRegexp(re ...any) error
- func (lc *LogC) Debug(msg ...any)
- func (lc *LogC) Debugf(format string, msg ...any)
- func (lc *LogC) DontHideToken()
- func (lc *LogC) Error(msg ...any)
- func (lc *LogC) Errorf(format string, msg ...any)
- func (lc *LogC) Fatal(msg ...any)
- func (lc *LogC) Fatalf(format string, msg ...any)
- func (lc *LogC) Info(msg ...any)
- func (lc *LogC) Infof(format string, msg ...any)
- func (lc *LogC) Log(msg ...any)
- func (lc *LogC) Logf(format string, msg ...any)
- func (lc *LogC) SetLogLevel(level int)
- func (lc *LogC) SetOutput(w io.Writer, index ...int)
- func (lc *LogC) SetPrefix(prefix string)
- func (lc *LogC) StderrTo(w io.Writer)
- func (lc *LogC) StdoutTo(w io.Writer)
- func (lc *LogC) Trace(msg ...any)
- func (lc *LogC) Tracef(format string, msg ...any)
- func (lc *LogC) Warn(msg ...any)
- func (lc *LogC) Warnf(format string, msg ...any)
Constants ¶
const ( LevelFatal = iota - 3 LevelError LevelWarning LevelNormal LevelInfo LevelDebug LevelTrace )
const ( TraceLog = iota DebugLog InfoLog NormalLog WarnLog ErrorLog FatalLog )
Variables ¶
This section is empty.
Functions ¶
func AppendPassphraseRegexp ¶
AppendPassphraseRegexp is used to append the regexps to match the tokens/passphrases you want to hide them in the log output. Here are two type supported, string and *regexp.Regexp.
func DontHideToken ¶
func DontHideToken()
DontHideToken is used to un-hide the tokens within log message, the default behavior is hiding those tokens.
func Fatal ¶
func Fatal(msg ...any)
Fatal print the message in the fatal level, and exit the program
func SetLogLevel ¶
func SetLogLevel(level int)
SetLogLevel is used to set the log level, the default log level is LevelNormal
func SetOutput ¶
SetOutput set the output of loggers in the default LogC instance specified by index, the index is optional, if no one provided, the all loggers will set the output to w.
Types ¶
type LogC ¶
type LogC struct {
// contains filtered or unexported fields
}
func (*LogC) AppendPassphraseRegexp ¶
AppendPassphraseRegexp is used to append the regexps to match the tokens/passphrases you want to hide them in the log output. Here are two type supported, string and *regexp.Regexp.
func (*LogC) DontHideToken ¶
func (lc *LogC) DontHideToken()
DontHideToken is used to un-hide the tokens within log message, the default behavior is hiding those tokens.
func (*LogC) SetLogLevel ¶
SetLogLevel is used to set the log level, the default log level is LevelNormal
func (*LogC) SetOutput ¶
SetOutput set the output of loggers in this LogC instance specified by index, the index is optional, if no one provided, the all loggers will set the output to w.
func (*LogC) SetPrefix ¶
SetPrefix is used to append a unique additional prefix to the current prefix.