log

package
v0.0.0-...-4d456dd Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ClrDEBUG = "\x1b[37;2m"
View Source
const ClrEnd = "\x1b[0m"
View Source
const ClrSuccess = "\x1b[32;2m"
View Source
const ClrWarn = "\x1b[33;2m"

Variables

This section is empty.

Functions

func Debug

func Debug(l interface{})

func Debugf

func Debugf(format string, a ...interface{})

func EnableDebug

func EnableDebug()

展示Debug日志

func EnableFileInfo

func EnableFileInfo()

在日志中展示相关的文件信息

func EnableWrite

func EnableWrite()

在打印日志的同时写入日志文件

func Error

func Error(l interface{})

func ErrorLine

func ErrorLine(l interface{})

func ErrorLinef

func ErrorLinef(format string, a ...interface{})

func Errorf

func Errorf(format string, a ...interface{})

func Info

func Info(l interface{})

func Infof

func Infof(l string, a ...interface{})

func Lock

func Lock()

func SetFilename

func SetFilename(name string)

设置日志文件的路径

func Success

func Success(l interface{})

func Successf

func Successf(format string, a ...interface{})

func Unlock

func Unlock()

func Warn

func Warn(l interface{})

func Warnf

func Warnf(format string, a ...interface{})

func Write

func Write(l interface{})

func Writef

func Writef(format string, a ...interface{})

Types

type Logger

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

func New

func New(out io.Writer, prefix string, flag int) *Logger

func (*Logger) Bytes

func (l *Logger) Bytes() []byte

func (*Logger) Output

func (l *Logger) Output(calldepth int, s string, color string) error

Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2.

func (*Logger) String

func (l *Logger) String() string

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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