-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.go
35 lines (25 loc) · 1.12 KB
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package logger
import (
"github.com/sirupsen/logrus"
)
// ILogger represents a logging interface.
type ILogger interface {
// SetLevel sets the log level.
SetLevel(level logrus.Level) ILogger
// Debug logs debug message with the given key/value pairs as context.
Debug(msg string, keysAndValues ...interface{})
// Info logs info message with the given key/value pairs as context.
Info(msg string, keysAndValues ...interface{})
// Warn logs warning message with the given key/value pairs as context.
Warn(msg string, keysAndValues ...interface{})
// Error logs an error, with the given message and key/value pairs as context.
Error(msg string, keysAndValues ...interface{})
// Fatal logs fatal message with the given key/value pairs as context.
Fatal(msg string, keysAndValues ...interface{})
// Panic logs panic message with the given key/value pairs as context.
Panic(msg string, keysAndValues ...interface{})
// WithValues returns a new Logger with additional key/value pairs.
WithValues(keysAndValues ...interface{}) ILogger
// WithError returns a new Logger with additional error.
WithError(err error) ILogger
}