Documentation
¶
Index ¶
- Constants
- func Debug(format string, v ...any)
- func DebugToConsole(format string, v ...any)
- func DebugToFile(format string, v ...any)
- func Error(format string, v ...any)
- func ErrorToConsole(format string, v ...any)
- func ErrorToFile(format string, v ...any)
- func Info(format string, v ...any)
- func InfoToConsole(format string, v ...any)
- func InfoToFile(format string, v ...any)
- func SetLogTime(timeFormat string, utc bool)
- func Warn(format string, v ...any)
- func WarnToConsole(format string, v ...any)
- func WarnToFile(format string, v ...any)
- func ZeroHook(h Hook) zeroHook
- type Config
- type Event
- type Hook
- type HookFunc
- type Level
- type Logger
- func AutoSkipFrameCount() *Logger
- func GetAccessLogger() *Logger
- func GetLogger() *Logger
- func New(c Config) (logger Logger, err error)
- func With(key string, a any) *Logger
- func WithCaller() *Logger
- func WithHook(h Hook) *Logger
- func WithHookFunc(h HookFunc) *Logger
- func WithRequestID(id string) *Logger
- func WithSender(sender string) *Logger
- func WithSkipFrameCount(skip int) *Logger
- func (l Logger) AutoSkipFrameCount() *Logger
- func (l Logger) Debug(format string, v ...any)
- func (l Logger) DebugToConsole(format string, v ...any)
- func (l Logger) DebugToFile(format string, v ...any)
- func (l Logger) Error(format string, v ...any)
- func (l Logger) ErrorToConsole(format string, v ...any)
- func (l Logger) ErrorToFile(format string, v ...any)
- func (l Logger) Info(format string, v ...any)
- func (l Logger) InfoToConsole(format string, v ...any)
- func (l Logger) InfoToFile(format string, v ...any)
- func (l Logger) Warn(format string, v ...any)
- func (l Logger) WarnToConsole(format string, v ...any)
- func (l Logger) WarnToFile(format string, v ...any)
- func (l Logger) With(key string, val any) *Logger
- func (l Logger) WithCaller() *Logger
- func (l Logger) WithHook(h Hook) *Logger
- func (l Logger) WithHookFunc(h HookFunc) *Logger
- func (l Logger) WithRequestID(id string) *Logger
- func (l Logger) WithSender(sender string) *Logger
- func (l Logger) WithSkipFrameCount(skip int) *Logger
Constants ¶
View Source
const (
TimeFormat = "2006-01-02T15:04:05.000"
)
Variables ¶
This section is empty.
Functions ¶
func DebugToConsole ¶
func DebugToFile ¶
func ErrorToConsole ¶
func ErrorToFile ¶
func InfoToConsole ¶
func InfoToFile ¶
func SetLogTime ¶
func WarnToConsole ¶
func WarnToFile ¶
Types ¶
type Config ¶
type Config struct {
Level string `json:"level" mapstructure:"level"`
TimeFormat string `json:"time_format" mapstructure:"time_format"`
FilePath string `json:"filepath" mapstructure:"filepath"`
AccessFilePath string `json:"access_filepath" mapstructure:"access_filepath"`
MaxSize int `json:"max_size" mapstructure:"max_size"`
MaxAge int `json:"max_age" mapstructure:"max_age"`
MaxBackups int `json:"max_backups" mapstructure:"max_backups"`
Compress bool `json:"compress" mapstructure:"compress"`
UTCTime bool `json:"utc_time" mapstructure:"utc_time"`
EnableFile bool `json:"enable_file" mapstructure:"enable_file"`
EnableConsole bool `json:"enable_console" mapstructure:"enable_console"`
EnableAccessFile bool `json:"enable_access_file" mapstructure:"enable_access_file"`
EnableAccessConsole bool `json:"enable_access_console" mapstructure:"enable_access_console"`
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func AutoSkipFrameCount ¶
func AutoSkipFrameCount() *Logger
func GetAccessLogger ¶
func GetAccessLogger() *Logger
func WithCaller ¶
func WithCaller() *Logger
func WithHookFunc ¶
func WithRequestID ¶
func WithSender ¶
func WithSkipFrameCount ¶
func (Logger) AutoSkipFrameCount ¶
func (Logger) DebugToConsole ¶
func (Logger) DebugToFile ¶
func (Logger) ErrorToConsole ¶
func (Logger) ErrorToFile ¶
func (Logger) InfoToConsole ¶
func (Logger) InfoToFile ¶
func (Logger) WarnToConsole ¶
func (Logger) WarnToFile ¶
func (Logger) WithCaller ¶
func (Logger) WithHookFunc ¶
func (Logger) WithRequestID ¶
func (Logger) WithSender ¶
func (Logger) WithSkipFrameCount ¶
Click to show internal directories.
Click to hide internal directories.