logger

package
v0.0.0-...-348a65b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARN
	ERROR
)
View Source
const (
	CONSOLE = iota
	FILE
	BOTH
	NEITHER
)

Variables

View Source
var (
	GREEN     = string([]byte{27, 91, 51, 50, 109})
	WHITE     = string([]byte{27, 91, 51, 55, 109})
	YELLOW    = string([]byte{27, 91, 51, 51, 109})
	RED       = string([]byte{27, 91, 51, 49, 109})
	BLUE      = string([]byte{27, 91, 51, 52, 109})
	MAGENTA   = string([]byte{27, 91, 51, 53, 109})
	CYAN      = string([]byte{27, 91, 51, 54, 109})
	RESET     = string([]byte{27, 91, 48, 109})
	ALL_COLOR = []string{GREEN, WHITE, YELLOW, RED, BLUE, MAGENTA, CYAN, RESET}
)

Functions

func CloseLogger

func CloseLogger()

func Debug

func Debug(msg string, param ...any)

func Error

func Error(msg string, param ...any)

func Info

func Info(msg string, param ...any)

func InitLogger

func InitLogger()

func SetLogLevel

func SetLogLevel(logLevel string)

func Stack

func Stack() string

func StackAll

func StackAll() string

func Warn

func Warn(msg string, param ...any)

Types

type LogInfo

type LogInfo struct {
	Level       int
	Msg         string
	FileName    string
	FuncName    string
	Line        int
	GoroutineId string
	ThreadId    string
}

type Logger

type Logger struct {
	AppName     string
	Level       int
	Mode        int
	Track       bool
	MaxSize     int32
	File        *os.File
	LogInfoChan chan *LogInfo
}
var LOG *Logger = nil

Jump to

Keyboard shortcuts

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