github.com/kelleygo/clashcore@v1.0.2/log/sing.go (about)

     1  package log
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  
     7  	L "github.com/sagernet/sing/common/logger"
     8  )
     9  
    10  type singLogger struct{}
    11  
    12  func (l singLogger) TraceContext(ctx context.Context, args ...any) {
    13  	Debugln(fmt.Sprint(args...))
    14  }
    15  
    16  func (l singLogger) DebugContext(ctx context.Context, args ...any) {
    17  	Debugln(fmt.Sprint(args...))
    18  }
    19  
    20  func (l singLogger) InfoContext(ctx context.Context, args ...any) {
    21  	Infoln(fmt.Sprint(args...))
    22  }
    23  
    24  func (l singLogger) WarnContext(ctx context.Context, args ...any) {
    25  	Warnln(fmt.Sprint(args...))
    26  }
    27  
    28  func (l singLogger) ErrorContext(ctx context.Context, args ...any) {
    29  	Errorln(fmt.Sprint(args...))
    30  }
    31  
    32  func (l singLogger) FatalContext(ctx context.Context, args ...any) {
    33  	Fatalln(fmt.Sprint(args...))
    34  }
    35  
    36  func (l singLogger) PanicContext(ctx context.Context, args ...any) {
    37  	Fatalln(fmt.Sprint(args...))
    38  }
    39  
    40  func (l singLogger) Trace(args ...any) {
    41  	Debugln(fmt.Sprint(args...))
    42  }
    43  
    44  func (l singLogger) Debug(args ...any) {
    45  	Debugln(fmt.Sprint(args...))
    46  }
    47  
    48  func (l singLogger) Info(args ...any) {
    49  	Infoln(fmt.Sprint(args...))
    50  }
    51  
    52  func (l singLogger) Warn(args ...any) {
    53  	Warnln(fmt.Sprint(args...))
    54  }
    55  
    56  func (l singLogger) Error(args ...any) {
    57  	Errorln(fmt.Sprint(args...))
    58  }
    59  
    60  func (l singLogger) Fatal(args ...any) {
    61  	Fatalln(fmt.Sprint(args...))
    62  }
    63  
    64  func (l singLogger) Panic(args ...any) {
    65  	Fatalln(fmt.Sprint(args...))
    66  }
    67  
    68  var SingLogger L.ContextLogger = singLogger{}