Documentation ¶
Index ¶
- Constants
- func Debug(args ...any)
- func Debugf(format string, args ...any)
- func EachLevel(fn func(level Level) (continued bool))
- func Error(args ...any)
- func Errorf(format string, args ...any)
- func Final()
- func Info(args ...any)
- func Infof(format string, args ...any)
- func Init(consoleColorful bool, option *LoggerOption, writers ...IWriter)
- func Warn(args ...any)
- func Warnf(format string, args ...any)
- type FileOption
- type ILogger
- type IRecord
- type IWriter
- type Level
- type LoggerOption
Constants ¶
View Source
const ( LevelDebug = 1 << (iota - 1) // 调试 LevelInfo // 追踪 LevelWarn // 警告 LevelError // 错误 LevelAll = LevelDebug | LevelInfo | LevelWarn | LevelError )
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(consoleColorful bool, option *LoggerOption, writers ...IWriter)
Types ¶
type FileOption ¶
type ILogger ¶
type ILogger interface { Destroy() SetLevel(level Level) Debug(args ...any) Debugf(format string, args ...any) Info(args ...any) Infof(format string, args ...any) Warn(args ...any) Warnf(format string, args ...any) Error(args ...any) Errorf(format string, args ...any) }
func CreateConsoleLogger ¶
func CreateConsoleLogger() ILogger
func CreateLogger ¶
func CreateLogger(option LoggerOption, writers ...IWriter) (ILogger, error)
func MustCreateLogger ¶
func MustCreateLogger(option LoggerOption, writers ...IWriter) ILogger
func MustGetLogger ¶
type IWriter ¶
type IWriter interface { Write(record IRecord) Destroy() }
func ConsoleWriter ¶
func ConsoleWriter() IWriter
func CreateFileWriter ¶
func CreateFileWriter(option *FileOption) (IWriter, error)
func MustCreateFileWriter ¶
func MustCreateFileWriter(option *FileOption) IWriter
func MustGetWriter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.