-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.go
More file actions
46 lines (41 loc) · 1011 Bytes
/
logger.go
File metadata and controls
46 lines (41 loc) · 1011 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
38
39
40
41
42
43
44
45
46
package golog
import "io"
type Level uint32
const (
FatalLevel Level = iota
ErrorLevel
WarnLevel
InfoLevel
DebugLevel
TraceLevel
)
type Logger interface {
SetLevel(level Level)
SetOutput(output io.Writer)
Writer(level Level) io.Writer
Trace() LoggerInstance
WriteTrace(args ...any)
WriteTracef(format string, args ...any)
Debug() LoggerInstance
WriteDebug(args ...any)
WriteDebugf(format string, args ...any)
Info() LoggerInstance
WriteInfo(args ...any)
WriteInfof(format string, args ...any)
Warn() LoggerInstance
WriteWarn(args ...any)
WriteWarnf(format string, args ...any)
Error() LoggerInstance
WriteError(args ...any)
WriteErrorf(format string, args ...any)
Fatal() LoggerInstance
WriteFatal(args ...any)
WriteFatalf(format string, args ...any)
}
type LoggerInstance interface {
WithError(err error) LoggerInstance
WithField(key string, value any) LoggerInstance
WithFields(fields map[string]any) LoggerInstance
Write(args ...any)
Writef(format string, args ...any)
}