mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
Inbound rule support
This commit is contained in:
23
log/log.go
23
log/log.go
@@ -3,10 +3,27 @@ package log
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
)
|
||||
|
||||
type Logger interface {
|
||||
logrus.FieldLogger
|
||||
WithContext(ctx context.Context) *logrus.Entry
|
||||
Trace(args ...interface{})
|
||||
Debug(args ...interface{})
|
||||
Info(args ...interface{})
|
||||
Print(args ...interface{})
|
||||
Warn(args ...interface{})
|
||||
Warning(args ...interface{})
|
||||
Error(args ...interface{})
|
||||
Fatal(args ...interface{})
|
||||
Panic(args ...interface{})
|
||||
WithContext(ctx context.Context) Logger
|
||||
WithPrefix(prefix string) Logger
|
||||
Close() error
|
||||
}
|
||||
|
||||
func NewLogger(options option.LogOption) (Logger, error) {
|
||||
if options.Disabled {
|
||||
return NewNopLogger(), nil
|
||||
}
|
||||
return NewLogrusLogger(options)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user