mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
go lint
This commit is contained in:
parent
48990da22e
commit
bbab3fe9ca
@ -20,6 +20,7 @@ import (
|
||||
"github.com/fatedier/beego/logs"
|
||||
)
|
||||
|
||||
// Log is the under log object
|
||||
var Log *logs.BeeLogger
|
||||
|
||||
func init() {
|
||||
@ -33,6 +34,7 @@ func InitLog(logWay string, logFile string, logLevel string, maxdays int64) {
|
||||
SetLogLevel(logLevel)
|
||||
}
|
||||
|
||||
// SetLogFile to configure log params
|
||||
// logWay: file or console
|
||||
func SetLogFile(logWay string, logFile string, maxdays int64) {
|
||||
if logWay == "console" {
|
||||
@ -43,6 +45,7 @@ func SetLogFile(logWay string, logFile string, maxdays int64) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetLogLevel set log level, default is warning
|
||||
// value: error, warning, info, debug, trace
|
||||
func SetLogLevel(logLevel string) {
|
||||
level := 4 // warning
|
||||
@ -85,7 +88,7 @@ func Trace(format string, v ...interface{}) {
|
||||
Log.Trace(format, v...)
|
||||
}
|
||||
|
||||
// Logger
|
||||
// Logger is the log interface
|
||||
type Logger interface {
|
||||
AddLogPrefix(string)
|
||||
GetPrefixStr() string
|
||||
|
@ -31,6 +31,7 @@ type WebsocketListener struct {
|
||||
httpMutex *http.ServeMux
|
||||
}
|
||||
|
||||
// NewWebsocketListener to handle websocket connections
|
||||
// ln: tcp listener for websocket connections
|
||||
func NewWebsocketListener(ln net.Listener) (wl *WebsocketListener) {
|
||||
wl = &WebsocketListener{
|
||||
|
Loading…
Reference in New Issue
Block a user