-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Error in logging system when appending strings
- Loading branch information
1 parent
78830bc
commit 29e2416
Showing
5 changed files
with
29 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,31 @@ | ||
package log | ||
|
||
import ( | ||
log "github.com/sirupsen/logrus" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// Initialize log level | ||
func Initialize(level string) { | ||
|
||
switch level { | ||
case "debug": | ||
log.SetLevel(log.DebugLevel) | ||
logrus.SetLevel(logrus.DebugLevel) | ||
break | ||
case "info": | ||
log.SetLevel(log.InfoLevel) | ||
logrus.SetLevel(logrus.InfoLevel) | ||
break | ||
case "error": | ||
log.SetLevel(log.ErrorLevel) | ||
logrus.SetLevel(logrus.ErrorLevel) | ||
break | ||
case "warn": | ||
log.SetLevel(log.WarnLevel) | ||
logrus.SetLevel(logrus.WarnLevel) | ||
break | ||
case "fatal": | ||
log.SetLevel(log.FatalLevel) | ||
logrus.SetLevel(logrus.FatalLevel) | ||
break | ||
case "panic": | ||
log.SetLevel(log.PanicLevel) | ||
logrus.SetLevel(logrus.PanicLevel) | ||
break | ||
} | ||
|
||
} | ||
|
||
// Info level | ||
func Info(text string, arg ...interface{}) { | ||
log.Infof(text, arg) | ||
} | ||
|
||
// Error level | ||
func Error(text string, arg ...interface{}) { | ||
log.Errorf(text, arg) | ||
} | ||
|
||
// Debug level | ||
func Debug(text string, arg ...interface{}) { | ||
log.Debugf(text, arg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters