-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
nop.go
88 lines (61 loc) · 1.59 KB
/
nop.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
package log
import (
"context"
"os"
"github.com/sagernet/sing/common/observable"
)
var _ ObservableFactory = (*nopFactory)(nil)
type nopFactory struct{}
func NewNOPFactory() ObservableFactory {
return (*nopFactory)(nil)
}
func (f *nopFactory) Start() error {
return nil
}
func (f *nopFactory) Close() error {
return nil
}
func (f *nopFactory) Level() Level {
return LevelTrace
}
func (f *nopFactory) SetLevel(level Level) {
}
func (f *nopFactory) Logger() ContextLogger {
return f
}
func (f *nopFactory) NewLogger(tag string) ContextLogger {
return f
}
func (f *nopFactory) Trace(args ...any) {
}
func (f *nopFactory) Debug(args ...any) {
}
func (f *nopFactory) Info(args ...any) {
}
func (f *nopFactory) Warn(args ...any) {
}
func (f *nopFactory) Error(args ...any) {
}
func (f *nopFactory) Fatal(args ...any) {
}
func (f *nopFactory) Panic(args ...any) {
}
func (f *nopFactory) TraceContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) DebugContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) InfoContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) WarnContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) ErrorContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) FatalContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) PanicContext(ctx context.Context, args ...any) {
}
func (f *nopFactory) Subscribe() (subscription observable.Subscription[Entry], done <-chan struct{}, err error) {
return nil, nil, os.ErrInvalid
}
func (f *nopFactory) UnSubscribe(subscription observable.Subscription[Entry]) {
}