-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.go
31 lines (24 loc) · 750 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
package logging
import (
"fmt"
)
// L is the global instance of the logger
var L = &LoggerStdOut{}
// 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...)
}