mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-20 01:45:00 +03:00
Add SSH inbound, log level. Update MTPROXY. Fixes
This commit is contained in:
@@ -39,6 +39,10 @@ func Info(args ...any) {
|
||||
std.Info(args...)
|
||||
}
|
||||
|
||||
func Notice(args ...any) {
|
||||
std.Notice(args...)
|
||||
}
|
||||
|
||||
func Warn(args ...any) {
|
||||
std.Warn(args...)
|
||||
}
|
||||
@@ -67,6 +71,10 @@ func InfoContext(ctx context.Context, args ...any) {
|
||||
std.InfoContext(ctx, args...)
|
||||
}
|
||||
|
||||
func NoticeContext(ctx context.Context, args ...any) {
|
||||
std.NoticeContext(ctx, args...)
|
||||
}
|
||||
|
||||
func WarnContext(ctx context.Context, args ...any) {
|
||||
std.WarnContext(ctx, args...)
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ func (f Formatter) Format(ctx context.Context, level Level, tag string, message
|
||||
levelString = aurora.White(levelString).String()
|
||||
case LevelInfo:
|
||||
levelString = aurora.Cyan(levelString).String()
|
||||
case LevelNotice:
|
||||
levelString = aurora.Green(levelString).String()
|
||||
case LevelWarn:
|
||||
levelString = aurora.Yellow(levelString).String()
|
||||
case LevelError, LevelFatal, LevelPanic:
|
||||
@@ -97,6 +99,8 @@ func (f Formatter) FormatWithSimple(ctx context.Context, level Level, tag string
|
||||
levelString = aurora.White(levelString).String()
|
||||
case LevelInfo:
|
||||
levelString = aurora.Cyan(levelString).String()
|
||||
case LevelNotice:
|
||||
levelString = aurora.Green(levelString).String()
|
||||
case LevelWarn:
|
||||
levelString = aurora.Yellow(levelString).String()
|
||||
case LevelError, LevelFatal, LevelPanic:
|
||||
|
||||
@@ -11,6 +11,7 @@ const (
|
||||
LevelFatal
|
||||
LevelError
|
||||
LevelWarn
|
||||
LevelNotice
|
||||
LevelInfo
|
||||
LevelDebug
|
||||
LevelTrace
|
||||
@@ -24,6 +25,8 @@ func FormatLevel(level Level) string {
|
||||
return "debug"
|
||||
case LevelInfo:
|
||||
return "info"
|
||||
case LevelNotice:
|
||||
return "notice"
|
||||
case LevelWarn:
|
||||
return "warn"
|
||||
case LevelError:
|
||||
@@ -45,6 +48,8 @@ func ParseLevel(level string) (Level, error) {
|
||||
return LevelDebug, nil
|
||||
case "info":
|
||||
return LevelInfo, nil
|
||||
case "notice":
|
||||
return LevelNotice, nil
|
||||
case "warn", "warning":
|
||||
return LevelWarn, nil
|
||||
case "error":
|
||||
|
||||
@@ -47,6 +47,9 @@ func (f *nopFactory) Debug(args ...any) {
|
||||
func (f *nopFactory) Info(args ...any) {
|
||||
}
|
||||
|
||||
func (f *nopFactory) Notice(args ...any) {
|
||||
}
|
||||
|
||||
func (f *nopFactory) Warn(args ...any) {
|
||||
}
|
||||
|
||||
@@ -68,6 +71,9 @@ func (f *nopFactory) DebugContext(ctx context.Context, args ...any) {
|
||||
func (f *nopFactory) InfoContext(ctx context.Context, args ...any) {
|
||||
}
|
||||
|
||||
func (f *nopFactory) NoticeContext(ctx context.Context, args ...any) {
|
||||
}
|
||||
|
||||
func (f *nopFactory) WarnContext(ctx context.Context, args ...any) {
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,10 @@ func (l *observableLogger) Info(args ...any) {
|
||||
l.InfoContext(context.Background(), args...)
|
||||
}
|
||||
|
||||
func (l *observableLogger) Notice(args ...any) {
|
||||
l.NoticeContext(context.Background(), args...)
|
||||
}
|
||||
|
||||
func (l *observableLogger) Warn(args ...any) {
|
||||
l.WarnContext(context.Background(), args...)
|
||||
}
|
||||
@@ -182,6 +186,10 @@ func (l *observableLogger) InfoContext(ctx context.Context, args ...any) {
|
||||
l.Log(ctx, LevelInfo, args)
|
||||
}
|
||||
|
||||
func (l *observableLogger) NoticeContext(ctx context.Context, args ...any) {
|
||||
l.Log(ctx, LevelNotice, args)
|
||||
}
|
||||
|
||||
func (l *observableLogger) WarnContext(ctx context.Context, args ...any) {
|
||||
l.Log(ctx, LevelWarn, args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user