github.com/sagernet/sing@v0.4.0-beta.19.0.20240518125136-f67a0988a636/common/logger/nop.go (about) 1 package logger 2 3 import ( 4 "context" 5 ) 6 7 func NOP() ContextLogger { 8 return (*nopLogger)(nil) 9 } 10 11 type nopLogger struct{} 12 13 func (f *nopLogger) Trace(args ...any) { 14 } 15 16 func (f *nopLogger) Debug(args ...any) { 17 } 18 19 func (f *nopLogger) Info(args ...any) { 20 } 21 22 func (f *nopLogger) Warn(args ...any) { 23 } 24 25 func (f *nopLogger) Error(args ...any) { 26 } 27 28 func (f *nopLogger) Fatal(args ...any) { 29 } 30 31 func (f *nopLogger) Panic(args ...any) { 32 } 33 34 func (f *nopLogger) TraceContext(ctx context.Context, args ...any) { 35 } 36 37 func (f *nopLogger) DebugContext(ctx context.Context, args ...any) { 38 } 39 40 func (f *nopLogger) InfoContext(ctx context.Context, args ...any) { 41 } 42 43 func (f *nopLogger) WarnContext(ctx context.Context, args ...any) { 44 } 45 46 func (f *nopLogger) ErrorContext(ctx context.Context, args ...any) { 47 } 48 49 func (f *nopLogger) FatalContext(ctx context.Context, args ...any) { 50 } 51 52 func (f *nopLogger) PanicContext(ctx context.Context, args ...any) { 53 }