log

package
v0.0.8-20250724 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black(s string) string

func BlackB

func BlackB(s string) string

func Blue

func Blue(s string) string

func BlueB

func BlueB(s string) string

func Bold

func Bold(s string) string

func Clear

func Clear(s string) string

Clear "\x1b[%sm%s\x1b[0m"

func Count

func Count(s string) int

func Cyan

func Cyan(s string) string

func CyanB

func CyanB(s string) string

func Data

func Data(s ...any)

func Dataf

func Dataf(format string, s ...any)

func Debug

func Debug(s ...any)

func Debugf

func Debugf(format string, s ...any)

func Disabled

func Disabled()

func Enabled

func Enabled()

func Error

func Error(s ...any)

func Errorf

func Errorf(format string, s ...any)

func GetCallerLevel

func GetCallerLevel() int

GetCallerLevel 获取当前的调用者层级设置 返回当前设置的调用栈起始层级

func Green

func Green(s string) string

func GreenB

func GreenB(s string) string

func Important

func Important(s string) string

func Info

func Info(s ...any)

func Infof

func Infof(format string, s ...any)

func Italic

func Italic(s string) string

func LogString

func LogString(level Level, s string) string

func Overturn

func Overturn(s string) string

func Printf

func Printf(level Level, format string, s ...any)

func Println

func Println(level Level, s ...any)

func Purple

func Purple(s string) string

func PurpleB

func PurpleB(s string) string

func Random

func Random(s string) string

func RandomImportant

func RandomImportant(s string) string

func Red

func Red(s string) string

func RedB

func RedB(s string) string

func SetCallerLevel

func SetCallerLevel(level int)

SetCallerLevel 设置日志调用者查找的起始层级 level: 起始层级,通常为3,如果需要跳过更多层级可以增加此值 此函数影响所有日志输出中显示的调用者位置

func SetLevel

func SetLevel(level Level)

func SetOutput

func SetOutput(writer io.Writer)

func SetOutputFile

func SetOutputFile(level Level, fileName string)

func StrMapRandomColor

func StrMapRandomColor(m map[string]string, printKey bool, importantKey []string, varyImportantKey []string) string

func StrSliceRandomColor

func StrSliceRandomColor(strSlice []string) string

func Tips

func Tips(s string) string

func Underline

func Underline(s string) string

func Warn

func Warn(s ...any)

func Warnf

func Warnf(format string, s ...any)

func Warning

func Warning(s string) string

func White

func White(s string) string

func WhiteB

func WhiteB(s string) string

func Yellow

func Yellow(s string) string

func YellowB

func YellowB(s string) string

Types

type Level

type Level int
const (
	DEBUG Level = 0x0000a1
	INFO  Level = 0x0000b2
	WARN  Level = 0x0000c3
	ERROR Level = 0x0000d4
	DATA  Level = 0x0000e5
	NONE  Level = 0x0000f6
)

type Logger

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

func (*Logger) Printf

func (l *Logger) Printf(format string, s ...any)

func (*Logger) Println

func (l *Logger) Println(s ...any)

Jump to

Keyboard shortcuts

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