mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 05:44:12 +08:00
supress health check log
This commit is contained in:
parent
a4d340f91f
commit
91e4e095de
@ -7,6 +7,7 @@ import (
|
||||
|
||||
"net"
|
||||
|
||||
"github.com/sagernet/sing-box/log"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
)
|
||||
@ -34,6 +35,7 @@ func newHTTPClient(detour N.Dialer, timeout time.Duration) *http.Client {
|
||||
tr := &http.Transport{
|
||||
DisableKeepAlives: true,
|
||||
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
ctx = log.ContextWithOverrideLevel(ctx, log.LevelDebug)
|
||||
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
|
||||
},
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ func ContextWithOverrideLevel(ctx context.Context, level Level) context.Context
|
||||
|
||||
func OverrideLevelFromContext(origin Level, ctx context.Context) Level {
|
||||
level, loaded := ctx.Value((*overrideLevelKey)(nil)).(Level)
|
||||
if !loaded || origin < level {
|
||||
if !loaded || origin > level {
|
||||
return origin
|
||||
}
|
||||
return level
|
||||
|
Loading…
x
Reference in New Issue
Block a user