-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogging.go
More file actions
37 lines (29 loc) · 864 Bytes
/
Copy pathlogging.go
File metadata and controls
37 lines (29 loc) · 864 Bytes
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
37
package thing
import (
"io"
"github.com/burugo/thing/internal/logging"
)
// LogLevel controls Thing library log verbosity.
type LogLevel = logging.Level
const (
LogDefault LogLevel = logging.Default
LogSilent LogLevel = logging.Silent
LogError LogLevel = logging.Error
LogWarn LogLevel = logging.Warn
LogInfo LogLevel = logging.Info
LogDebug LogLevel = logging.Debug
)
// Logger is the minimal interface required for Thing logging.
type Logger = logging.Logger
// SetLogger sets the global Thing logger. Passing nil disables Thing logs.
func SetLogger(logger Logger) {
logging.SetLogger(logger)
}
// SetLogOutput sends Thing logs to w. Passing nil disables Thing logs.
func SetLogOutput(w io.Writer) {
logging.SetOutput(w)
}
// SetLogLevel sets the global Thing log level.
func SetLogLevel(level LogLevel) {
logging.SetLevel(level)
}