package
0.0.9
Repository: https://github.com/cc360428/helppackage.git
Documentation: pkg.go.dev

# README

logs

Cc

    var err error
    uploadDir := "static/logger/" + time.Now().Format("2006/01/02/")
    err = os.MkdirAll(uploadDir, 777)
    if err != nil {
        logs.Error(err.Error())
    }
    err = logs.SetLogger(logs.AdapterMultiFile, `{"filename":"`+uploadDir+`/33.log","separate":["emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"]}`)
    if err != nil {
        logs.Error("日志输出错误!", err.Error())
    }
    //logs := logs.NewLogger()
    logs.Info("错误")
    //logs.Info("你是")
    logs.Error("error", errors.New("错误"))

# Packages

Package alils implements the SDK(v0.5.0) of Simple Log Service(abbr.
No description provided by the author

# Functions

AccessLog - Format and print access log.
Alert logs a message at alert level.
Async set the beelogger with Async mode and hold msglen messages.
ColorByMethod return color by http code.
ColorByStatus return color by http code 2xx return Green 3xx return White 4xx return Yellow 5xx return Red.
Critical logs a message at critical level.
Debug logs a message at debug level.
Emergency logs a message at emergency level.
EnableFuncCallDepth enable log funcCallDepth.
Error logs a message at error level.
GetBeeLogger returns the default BeeLogger.
GetLogger returns the default BeeLogger.
Info compatibility alias for Warning().
Informational logs a message at info level.
NewConn create new ConnWrite returning as LoggerInterface.
NewConsole create ConsoleWriter returning as LoggerInterface.
NewLogger returns a new BeeLogger.
Notice logs a message at notice level.
Register makes a log provide available by the provided name.
Reset will remove all the adapter.
ResetColor return reset color.
SetLevel sets the global log level used by the simple logger.
SetLogFuncCall set the CallDepth, default is 4.
SetLogFuncCallDepth set log funcCallDepth.
SetLogger sets a new logger.
SetPrefix sets the prefix.
Trace logs a message at trace level.
Warn compatibility alias for Warning().
Warning logs a message at warning level.

# Constants

Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
Name for adapter with beego official support.
RFC5424 log message levels.
RFC5424 log message levels.
RFC5424 log message levels.
RFC5424 log message levels.
RFC5424 log message levels.
Legacy log level constants to ensure backwards compatibility.
RFC5424 log message levels.
RFC5424 log message levels.
Legacy log level constants to ensure backwards compatibility.
Legacy log level constants to ensure backwards compatibility.
RFC5424 log message levels.

# Structs

AccessLogRecord struct for holding access log data.
BeeLogger is default logger in beego application.
JLWriter implements beego LoggerInterface and is used to send jiaoliao webhook.
SLACKWriter implements beego LoggerInterface and is used to send jiaoliao webhook.
SMTPWriter implements LoggerInterface and is used to send emails via given SMTP-server.

# Interfaces

Logger defines the behavior of a log provider.