logs

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 12 Imported by: 19

Documentation

Index

Constants

View Source
const (
	// LevelDebug defines debug log level.
	LevelDebug = zap.DebugLevel
	// LevelInfo defines info log level.
	LevelInfo = zap.InfoLevel
	// LevelWarn defines warn log level.
	LevelWarn = zap.WarnLevel
	// LevelError defines error log level.
	LevelError = zap.WarnLevel

	AdapterConsole = "console"
	AdapterFile    = "file"
)

常量定义

Variables

This section is empty.

Functions

func AddWriter

func AddWriter(w io.Writer)

AddWriter .

func CbDebug

func CbDebug(v ...interface{})

CbDebug logs a message at debug level.

func CbDebugf

func CbDebugf(format string, v ...interface{})

CbDebugf logs a message at debug level.

func CbError

func CbError(v ...interface{})

CbError logs a message at error level.

func CbErrorf

func CbErrorf(format string, v ...interface{})

CbErrorf logs a message at error level.

func CbInfo

func CbInfo(v ...interface{})

CbInfo compatibility alias for Warning()

func CbInfof

func CbInfof(format string, v ...interface{})

CbInfof compatibility alias for Warning()

func CbWarn

func CbWarn(v ...interface{})

CbWarn compatibility alias for Warning()

func CbWarnf

func CbWarnf(format string, v ...interface{})

CbWarnf compatibility alias for Warning()

func Debug

func Debug(v ...interface{})

Debug logs a message at debug level.

func Debugf

func Debugf(f string, v ...interface{})

Debugf logs a message at debug level.

func Error

func Error(v ...interface{})

Error logs a message at error level.

func Errorf

func Errorf(f string, v ...interface{})

Errorf logs a message at error level.

func Exit

func Exit(msg string, exitCode ...int)

func GetAppName

func GetAppName() string

*

  • @description: 获取app的名称
  • @param {*}
  • @return {*}

func GetCallerFrame

func GetCallerFrame(skip int) (frame *runtime.Frame, ok bool)

func GetWriter

func GetWriter() io.Writer

*

  • @description:
  • @param {*}
  • @return {*}

func Info

func Info(v ...interface{})

Info compatibility alias for Warning()

func Infof

func Infof(f string, v ...interface{})

Infof compatibility alias for Warning()

func Init

func Init(logType string, haveColor bool)

*

  • @description: 日志初始化
  • @param {string} logType 日志类型 json/txt
  • @param {bool} haveColor 日志是否输出颜色
  • @return {*}

func Level

func Level() int

func LiteDebug

func LiteDebug(s string, v ...interface{})

Debug logs a message at debug level.

func LiteError

func LiteError(s string, v ...interface{})

Error logs a message at error level.

func LiteInfo

func LiteInfo(s string, v ...interface{})

Info compatibility alias for Warning()

func LiteWarn

func LiteWarn(s string, v ...interface{})

Warn compatibility alias for Warning()

func Msg

func Msg(msg string, level ...int)

Info compatibility alias for Warning()

func SetLevel

func SetLevel(l zapcore.Level)

SetLevel sets the global log level used by the simple logger.

func SetLogger

func SetLogger(adapter string, config ...string) error

SetLogger sets a new logger. 每种类型只能调用一次

func SetStringLevel

func SetStringLevel(l string)

*

  • @description: 用字符串的方式设置日志级别
  • @param {string} l
  • @return {*}

func TrimmedPath

func TrimmedPath(frame *runtime.Frame) string

func Warn

func Warn(v ...interface{})

Warn compatibility alias for Warning()

func Warnf

func Warnf(f string, v ...interface{})

Warnf compatibility alias for Warning()

func Where

func Where(l int) string

Where .

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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