-
Notifications
You must be signed in to change notification settings - Fork 18
/
logger.go
22 lines (15 loc) · 727 Bytes
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package pyroscope
import "fmt"
// these loggers implement the types.Logger interface
type noopLoggerImpl struct{}
func (*noopLoggerImpl) Infof(_ string, _ ...interface{}) {}
func (*noopLoggerImpl) Debugf(_ string, _ ...interface{}) {}
func (*noopLoggerImpl) Errorf(_ string, _ ...interface{}) {}
type standardLoggerImpl struct{}
func (*standardLoggerImpl) Infof(a string, b ...interface{}) { fmt.Printf("[INFO] "+a+"\n", b...) }
func (*standardLoggerImpl) Debugf(a string, b ...interface{}) { fmt.Printf("[DEBUG] "+a+"\n", b...) }
func (*standardLoggerImpl) Errorf(a string, b ...interface{}) { fmt.Printf("[ERROR] "+a+"\n", b...) }
var (
noopLogger = &noopLoggerImpl{}
StandardLogger = &standardLoggerImpl{}
)