log

package module
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

log

golang日志简易封装

Documentation

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
	LevelFatal = "fatal"
)

Variables

View Source
var LevelMap = map[string]int{
	LevelDebug: levelDebug,
	LevelInfo:  levelInfo,
	LevelWarn:  levelWarning,
	LevelError: levelError,
	LevelFatal: levelFatal,
}

Functions

func Debug

func Debug(format string, v ...any)

func Error

func Error(format string, v ...any)

func Fatal

func Fatal(format string, v ...any)

func Info

func Info(format string, v ...any)

func Init

func Init(config *Config)

Init 日志初始化函数

func Warn

func Warn(format string, v ...any)

Types

type Config

type Config struct {
	LogDir   string
	LogLevel string
}

Config 日志配置结构体

type LogBuild

type LogBuild struct {
	// contains filtered or unexported fields
}

func NewLogBuilder

func NewLogBuilder(level int, format, errStack string, v ...any) *LogBuild

Jump to

Keyboard shortcuts

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