forked from btcsuite/btclog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.go
90 lines (68 loc) · 3.14 KB
/
interface.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright (c) 2013-2017 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package btclog
import "context"
// Logger is an interface which describes a level-based logger. A default
// implementation of Logger is implemented by this package and can be created
// by calling (*Backend).Logger.
type Logger interface {
// Tracef formats message according to format specifier and writes to
// to log with LevelTrace.
Tracef(format string, params ...any)
// Debugf formats message according to format specifier and writes to
// log with LevelDebug.
Debugf(format string, params ...any)
// Infof formats message according to format specifier and writes to
// log with LevelInfo.
Infof(format string, params ...any)
// Warnf formats message according to format specifier and writes to
// to log with LevelWarn.
Warnf(format string, params ...any)
// Errorf formats message according to format specifier and writes to
// to log with LevelError.
Errorf(format string, params ...any)
// Criticalf formats message according to format specifier and writes to
// log with LevelCritical.
Criticalf(format string, params ...any)
// Trace formats message using the default formats for its operands
// and writes to log with LevelTrace.
Trace(v ...any)
// Debug formats message using the default formats for its operands
// and writes to log with LevelDebug.
Debug(v ...any)
// Info formats message using the default formats for its operands
// and writes to log with LevelInfo.
Info(v ...any)
// Warn formats message using the default formats for its operands
// and writes to log with LevelWarn.
Warn(v ...any)
// Error formats message using the default formats for its operands
// and writes to log with LevelError.
Error(v ...any)
// Critical formats message using the default formats for its operands
// and writes to log with LevelCritical.
Critical(v ...any)
// TraceS writes a structured log with the given message and key-value
// pair attributes with LevelTrace to the log.
TraceS(ctx context.Context, msg string, attrs ...any)
// DebugS writes a structured log with the given message and key-value
// pair attributes with LevelDebug to the log.
DebugS(ctx context.Context, msg string, attrs ...any)
// InfoS writes a structured log with the given message and key-value
// pair attributes with LevelInfo to the log.
InfoS(ctx context.Context, msg string, attrs ...any)
// WarnS writes a structured log with the given message and key-value
// pair attributes with LevelWarn to the log.
WarnS(ctx context.Context, msg string, err error, attrs ...any)
// ErrorS writes a structured log with the given message and key-value
// pair attributes with LevelError to the log.
ErrorS(ctx context.Context, msg string, err error, attrs ...any)
// CriticalS writes a structured log with the given message and
// key-value pair attributes with LevelCritical to the log.
CriticalS(ctx context.Context, msg string, err error, attrs ...any)
// Level returns the current logging level.
Level() Level
// SetLevel changes the logging level to the passed level.
SetLevel(level Level)
}