Skip to content
Snippets Groups Projects
Commit cb4fb568 authored by Cornel Rautenbach's avatar Cornel Rautenbach
Browse files

Merge branch 'main' of https://gitlab.com/uafrica/go-utils

parents 6e00a1da 8310482d
No related branches found
No related tags found
No related merge requests found
......@@ -8,3 +8,16 @@ require (
github.com/thoas/go-funk v0.9.1
golang.org/x/text v0.3.3
)
require (
github.com/go-pg/zerochecker v0.2.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/vmihailenco/bufpool v0.1.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.1 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 // indirect
mellium.im/sasl v0.2.1 // indirect
)
......@@ -36,33 +36,33 @@ func Fatal(args ...interface{}) {
}
func Errorf(format string, args ...interface{}) {
logger.WithFields(map[string]interface{}{"call_stack": errors.Stack(3)}).log(LevelError, 1, fmt.Sprintf(format, args...))
logger.log(LevelError, 1, fmt.Sprintf(format, args...))
}
func Error(args ...interface{}) {
logger.WithFields(map[string]interface{}{"call_stack": errors.Stack(3)}).log(LevelError, 1, fmt.Sprint(args...))
logger.log(LevelError, 1, fmt.Sprint(args...))
}
func Warnf(format string, args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprintf(format, args...))
logger.log(LevelWarn, 1, fmt.Sprintf(format, args...))
}
func Warn(args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprint(args...))
logger.log(LevelWarn, 1, fmt.Sprint(args...))
}
func Infof(format string, args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprintf(format, args...))
logger.log(LevelInfo, 1, fmt.Sprintf(format, args...))
}
func Info(args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprint(args...))
logger.log(LevelInfo, 1, fmt.Sprint(args...))
}
func Debugf(format string, args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprintf(format, args...))
logger.log(LevelDebug, 1, fmt.Sprintf(format, args...))
}
func Debug(args ...interface{}) {
logger.log(LevelError, 1, fmt.Sprint(args...))
logger.log(LevelDebug, 1, fmt.Sprint(args...))
}
......@@ -55,19 +55,19 @@ func (l Logger) Fatal(args ...interface{}) {
}
func (l Logger) Errorf(format string, args ...interface{}) {
l.WithFields(map[string]interface{}{"call_stack": errors.Stack(3)}).log(LevelError, 1, fmt.Sprintf(format, args...))
l.log(LevelError, 1, fmt.Sprintf(format, args...))
}
func (l Logger) Error(args ...interface{}) {
l.WithFields(map[string]interface{}{"call_stack": errors.Stack(3)}).log(LevelError, 1, fmt.Sprint(args...))
l.log(LevelError, 1, fmt.Sprint(args...))
}
func (l Logger) Warnf(format string, args ...interface{}) {
l.log(LevelError, 1, fmt.Sprintf(format, args...))
l.log(LevelWarn, 1, fmt.Sprintf(format, args...))
}
func (l Logger) Warn(args ...interface{}) {
l.log(LevelError, 1, fmt.Sprint(args...))
l.log(LevelWarn, 1, fmt.Sprint(args...))
}
func (l Logger) Infof(format string, args ...interface{}) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment