Documentation
¶
Index ¶
- func BasicLumberjackLogger(config *LogConfig) *lumberjack.Logger
- func ChangeLogLevel(level string) error
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Setup(ops ...Option)
- func Sync() error
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Write(p []byte) (int, error)
- type Formatter
- type Level
- type LogConfig
- type LogWriter
- type NLog
- func (n *NLog) Debug(args ...interface{})
- func (n *NLog) Debugf(format string, args ...interface{})
- func (n *NLog) Error(args ...interface{})
- func (n *NLog) Errorf(format string, args ...interface{})
- func (n *NLog) Fatal(args ...interface{})
- func (n *NLog) Fatalf(format string, args ...interface{})
- func (n *NLog) Info(args ...interface{})
- func (n *NLog) Infof(format string, args ...interface{})
- func (n *NLog) Warn(args ...interface{})
- func (n *NLog) Warnf(format string, args ...interface{})
- func (n *NLog) WithCtx(ctx context.Context) *NLog
- func (n *NLog) Write(p []byte) (int, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicLumberjackLogger ¶
func BasicLumberjackLogger(config *LogConfig) *lumberjack.Logger
func ChangeLogLevel ¶
Types ¶
type Formatter ¶
func NewDefaultFormatter ¶
func NewDefaultFormatter() Formatter
func NewGinLogFormatter ¶
func NewGinLogFormatter() Formatter
type Level ¶
type Level int
A Level is a logging priority. Higher levels are more important.
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel Level = iota // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel // PanicLevel logs a message, then panics. PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel // InvalidLevel is an invalid value for Level. // // Core implementations may panic if they see messages of this level. InvalidLevel = _maxLevel + 1 )
type LogConfig ¶
type LogConfig struct { LogLevel string LogPath string // MaxFileSizeMB is the maximum size in megabytes of the log file before it gets // rotated. It defaults to 100 megabytes. MaxFileSizeMB int // MaxFiles is the maximum number of old log files to retain. The default // is to retain all old log files MaxFiles int Compress bool }
type LogWriter ¶
type LogWriter interface { Infof(format string, args ...interface{}) Info(args ...interface{}) Debugf(format string, args ...interface{}) Debug(args ...interface{}) Warnf(format string, args ...interface{}) Warn(args ...interface{}) Errorf(format string, args ...interface{}) Error(args ...interface{}) Fatalf(format string, args ...interface{}) Fatal(args ...interface{}) Sync() error Write(p []byte) (int, error) ChangeLogLevel(newLevel string) error }
func GetDefaultLogWriter ¶
func GetDefaultLogWriter() LogWriter
type NLog ¶
type NLog struct {
// contains filtered or unexported fields
}
func DefaultLogger ¶
func DefaultLogger() *NLog
Source Files
¶
Click to show internal directories.
Click to hide internal directories.