nlog

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsoleLogger

func NewConsoleLogger() *consoleLogger

func NewFileLogger

func NewFileLogger(conf FileLoggerConfig) *fileLogger

Types

type FileLoggerConfig

type FileLoggerConfig struct {
	ErrorLogPath string
	InfoLogPath  string
	DebugLogPath string
}

type LogFormat

type LogFormat int
const (
	StrFormat LogFormat
	JsonFormat
)

type LogLevel

type LogLevel int

LogLevel 日志层级枚举

const (
	DEBUG LogLevel //dev
	INFO           //基础信息型
	ERROR          //错误型
)

func (LogLevel) BString

func (e LogLevel) BString() string

BString 枚举格式化函数

func (LogLevel) SString

func (e LogLevel) SString() string

SString 枚举格式化函数

type Logger

type Logger interface {
	Info(msg ...interface{})
	Error(msg ...interface{})
	Debug(msg ...interface{})
}

Logger 日志接口

type WriterHandler

type WriterHandler func(level LogLevel, by []byte)

WriterHandler 写入事件类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL