-
Notifications
You must be signed in to change notification settings - Fork 61
/
logging.go
36 lines (29 loc) · 920 Bytes
/
logging.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
36
package logging
import (
"fmt"
)
// Logger is our standard interface
type Logger interface {
Debug(message string, args ...interface{})
Info(message string, args ...interface{})
Warn(message string, args ...interface{})
Error(message string, args ...interface{})
}
// LoggerStdOut logs to std out
type LoggerStdOut struct{}
// Debug logs messages at DEBUG level
func (l LoggerStdOut) Debug(message string, args ...interface{}) {
fmt.Printf("[DEBUG] "+message, args...)
}
// Info logs messages at INFO level
func (l LoggerStdOut) Info(message string, args ...interface{}) {
fmt.Printf("[INFO] "+message, args...)
}
// Warn logs messages at WARN level
func (l LoggerStdOut) Warn(message string, args ...interface{}) {
fmt.Printf("[WARN] "+message, args...)
}
// Error logs messages at ERROR level
func (l LoggerStdOut) Error(message string, args ...interface{}) {
fmt.Printf("[ERROR] "+message, args...)
}