mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-05 04:47:37 +03:00
Add basic clash api
This commit is contained in:
parent
c7fabe40ed
commit
c5b3e8b042
36 changed files with 1498 additions and 41 deletions
|
@ -66,17 +66,16 @@ func (l *observableLogger) Log(ctx context.Context, level Level, args []any) {
|
|||
if level > l.level {
|
||||
return
|
||||
}
|
||||
message := l.formatter.Format(ctx, level, l.tag, F.ToString(args...), time.Now()) + "\n"
|
||||
message, messageSimple := l.formatter.FormatWithSimple(ctx, level, l.tag, F.ToString(args...), time.Now())
|
||||
if level == LevelPanic {
|
||||
panic(message)
|
||||
}
|
||||
l.writer.Write([]byte(message))
|
||||
l.writer.Write([]byte{'\n'})
|
||||
if level == LevelFatal {
|
||||
os.Exit(1)
|
||||
}
|
||||
if l.subscriber != nil {
|
||||
l.subscriber.Emit(Entry{level, message})
|
||||
}
|
||||
l.subscriber.Emit(Entry{level, messageSimple})
|
||||
}
|
||||
|
||||
func (l *observableLogger) Trace(args ...any) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue