Skip to content

🎧 Your Personal Streaming Service

Add trace level to log

Deluan57390fcda354
diff --git a/log/log.go b/log/log.go
index 36225c824..6d44a393d 100644
--- a/log/log.go
+++ b/log/log.go
@@ -20,6 +20,7 @@ const (
LevelWarn = Level(logrus.WarnLevel)
LevelInfo = Level(logrus.InfoLevel)
LevelDebug = Level(logrus.DebugLevel)
+ LevelTrace = Level(logrus.TraceLevel)
)
var (
@@ -84,6 +85,14 @@ func Debug(args ...interface{}) {
logger.Debug(msg)
}
+func Trace(args ...interface{}) {
+ if currentLevel < LevelTrace {
+ return
+ }
+ logger, msg := parseArgs(args)
+ logger.Trace(msg)
+}
+
func parseArgs(args []interface{}) (*logrus.Entry, string) {
var l *logrus.Entry
var err error