Skip to content

Commit

Permalink
fix: log level in some outouts
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Mar 17, 2024
1 parent cb80d59 commit 51b796d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion experimental/libbox/command_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *CommandServer) handleSelectOutbound(conn net.Conn) error {
if !selector.SelectOutbound(outboundTag) {
return writeError(conn, E.New("outbound not found in selector: ", outboundTag))
}
log.Warn("Hiddify! Command Select", outboundTag)
log.Info("Hiddify! Command Select", outboundTag)
s.urlTestUpdate.Update(2)
return writeError(conn, nil)
}
2 changes: 1 addition & 1 deletion outbound/urltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (s *URLTest) ListenPacket(ctx context.Context, destination M.Socksaddr) (ne
return s.group.interruptGroup.NewPacketConn(conn, interrupt.IsExternalConnectionFromContext(ctx)), nil
}
if !s.group.pauseManager.IsNetworkPaused() && s.group.udpConnectionFailureCount.IncrementConditionReset(MinFailureToReset) {
s.logger.Warn("Hiddify! UDP URLTest Outbound ", s.tag, " (", outboundToString(s.group.selectedOutboundUDP), ") failed to connect for ", MinFailureToReset, " times==> test proxies again!")
s.logger.Info("Hiddify! UDP URLTest Outbound ", s.tag, " (", outboundToString(s.group.selectedOutboundUDP), ") failed to connect for ", MinFailureToReset, " times==> test proxies again!")
s.group.selectedOutboundUDP = nil
s.group.urlTest(ctx, true)
}
Expand Down
8 changes: 4 additions & 4 deletions outbound/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (w *WireGuard) Close() error {
}

func (w *WireGuard) InterfaceUpdated() {
w.logger.Warn("Hiddify! Wirguard! Interface updated!XXX")
w.logger.Info("Hiddify! Wirguard! Interface updated!XXX")
// <-time.After(10 * time.Millisecond)
// if true {
// return
Expand Down Expand Up @@ -265,21 +265,21 @@ func (w *WireGuard) InterfaceUpdated() {
}

func (w *WireGuard) onPauseUpdated(event int) {
w.logger.Warn("Hiddify! Wirguard! on Pause updated! event=", event)
w.logger.Info("Hiddify! Wirguard! on Pause updated! event=", event)
// <-time.After(1000 * time.Millisecond)
switch event {

case pause.EventDevicePaused:
w.device.Down()
case pause.EventNetworkPause: //hiddify already handled in Interface Updated
err := w.device.Down()
w.logger.Warn("Hiddify! Wirguard! downing net! err=", err)
w.logger.Info("Hiddify! Wirguard! downing net! err=", err)
<-time.After(50 * time.Millisecond)
case pause.EventDeviceWake:
w.device.Up()
case pause.EventNetworkWake: //hiddify already handled in Interface Updated
err := w.device.Up()
w.logger.Warn("Hiddify! Wirguard! Uping net! err=", err)
w.logger.Info("Hiddify! Wirguard! Uping net! err=", err)
<-time.After(50 * time.Millisecond)
}
}
Expand Down
6 changes: 3 additions & 3 deletions route/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ func (r *Router) InterfaceFinder() control.InterfaceFinder {
}

func (r *Router) UpdateInterfaces() error {
r.logger.Warn("Hiddify!UpdateInterfaces ")
r.logger.Info("Hiddify!UpdateInterfaces ")
if r.platformInterface == nil || !r.platformInterface.UsePlatformInterfaceGetter() {
return r.interfaceFinder.update()
} else {
Expand Down Expand Up @@ -1170,7 +1170,7 @@ func (r *Router) NewError(ctx context.Context, err error) {
}

func (r *Router) notifyNetworkUpdate(event int) {
r.logger.Warn("Hiddify!notifyNetworkUpdate ", event)
r.logger.Info("Hiddify!notifyNetworkUpdate ", event)
if event == tun.EventNoRoute {
r.pauseManager.NetworkPause()
r.logger.Error("missing default interface")
Expand All @@ -1197,7 +1197,7 @@ func (r *Router) notifyNetworkUpdate(event int) {
}

func (r *Router) ResetNetwork() error {
r.logger.Warn("Hiddify!Reseting Network")
r.logger.Info("Hiddify!Reseting Network")
conntrack.Close()

for _, outbound := range r.sortedOutboundsByDependenciesHiddify {
Expand Down

0 comments on commit 51b796d

Please sign in to comment.