From 57390fcda354d6bdf6ad1d27a13dccd54015dba4 Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 10 Jan 2020 13:11:24 -0500 Subject: [PATCH] Add trace level to log --- log/log.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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