-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslog.go
49 lines (38 loc) · 1.48 KB
/
slog.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
37
38
39
40
41
42
43
44
45
46
47
48
49
// slog defines a common interface for loggers.
package slog
// Logger is the interface that all loggers should conform to.
//
type Logger interface {
// Fatal logs a fatal log and then exits the program.
// Arguments are handled in the manner of fmt.Print.
Fatal(args ...interface{})
// Fatalf logs a fatal log and then exits the program.
// Arguments are handled in the manner of fmt.Printf.
Fatalf(format string, args ...interface{})
// Error logs error logs.
// Arguments are handled in the manner of fmt.Print.
Error(args ...interface{})
// Errorf logs error logs.
// Arguments are handled in the manner of fmt.Printf.
Errorf(format string, args ...interface{})
// Warning logs warning logs.
// Arguments are handled in the manner of fmt.Print.
Warning(args ...interface{})
// Warning logs warning logs.
// Arguments are handled in the manner of fmt.Printf.
Warningf(format string, args ...interface{})
// Info logs informational logs.
// Arguments are handled in the manner of fmt.Print.
Info(args ...interface{})
// Infof logs informational logs.
// Arguments are handled in the manner of fmt.Printf.
Infof(format string, args ...interface{})
// Debug logs debugging logs.
// Arguments are handled in the manner of fmt.Print.
Debug(args ...interface{})
// Debugf logs debugging logs.
// Arguments are handled in the manner of fmt.Printf.
Debugf(format string, args ...interface{})
// Raw sends the string s to the logs without any additional formatting.
Raw(s string)
}