fix(logs): убрать пострим-шум из лога без debug

TURN urls, персона, попытки кредов и DTLS connect/close - на debug: на 8 стримах это десятки строк на старте.
This commit is contained in:
samosvalishe
2026-08-24 23:36:39 +03:00
parent aed2839c7d
commit c2a9f0f1d7
4 changed files with 8 additions and 8 deletions
@@ -93,7 +93,7 @@ func New(cfg Config) *Client {
c.identity = browserprofile.Identity{Seed: seed, Gen: c.gens.load(seed)}
c.persona = browserprofile.For(c.platform, c.identity)
if c.identity.Gen > 0 {
c.log.Infof("[VK Auth] Persona gen=%d restored | User-Agent: %s", c.identity.Gen, c.persona.UserAgent)
c.log.Debugf("[VK Auth] Persona gen=%d restored | User-Agent: %s", c.identity.Gen, c.persona.UserAgent)
}
return c
}
@@ -241,11 +241,11 @@ func (c *Client) fetch(ctx context.Context, link string, streamID int) (string,
jar := personanet.NewCookieJar()
for i := 0; i < len(c.credentials); {
creds := c.credentials[i]
c.log.Infof("[STREAM %d] [VK Auth] Trying credentials: client_id=%s", streamID, creds.ClientID)
c.log.Debugf("[STREAM %d] [VK Auth] Trying credentials: client_id=%s", streamID, creds.ClientID)
user, pass, addrs, err := c.tokenChain(ctx, link, streamID, creds, jar)
if err == nil {
c.log.Infof("[STREAM %d] [VK Auth] Success with client_id=%s", streamID, creds.ClientID)
c.log.Debugf("[STREAM %d] [VK Auth] Success with client_id=%s", streamID, creds.ClientID)
return user, pass, addrs, nil
}
lastErr = err
@@ -21,7 +21,7 @@ func (c *Client) getTokenChain(ctx context.Context, link string, streamID int, c
name := namegen.Generate()
escapedName := neturl.QueryEscape(name)
c.log.Infof("[STREAM %d] [VK Auth] Connecting Identity - Name: %s | User-Agent: %s", streamID, name, profile.UserAgent)
c.log.Debugf("[STREAM %d] [VK Auth] Connecting Identity - Name: %s | User-Agent: %s", streamID, name, profile.UserAgent)
if pageErr := c.openJoinPage(ctx, httpClient, profile, link); pageErr != nil {
c.log.Warnf("[STREAM %d] [VK Auth] join page warm-up failed: %v", streamID, pageErr)
@@ -43,9 +43,9 @@ func (c *Client) fetchTurnCreds(
return "", "", nil, fmt.Errorf("missing or empty urls in turn_server")
}
c.log.Infof("[STREAM %d] [VK Auth] TURN urls (%d total):", streamID, len(urlsRaw))
c.log.Debugf("[STREAM %d] [VK Auth] TURN urls (%d total):", streamID, len(urlsRaw))
for i, u := range urlsRaw {
c.log.Infof("[STREAM %d] [VK Auth] [%d] %v", streamID, i, u)
c.log.Debugf("[STREAM %d] [VK Auth] [%d] %v", streamID, i, u)
}
for _, u := range urlsRaw {
+2 -2
View File
@@ -160,9 +160,9 @@ func dtlsSession(dtlsctx context.Context, dtlscancel context.CancelFunc, deps *D
var dtlsConn net.Conn = dtlsRaw
defer func() {
_ = dtlsConn.Close()
deps.log().Infof("[STREAM %d] Closed DTLS connection", streamID)
deps.log().Debugf("[STREAM %d] Closed DTLS connection", streamID)
}()
deps.log().Infof("[STREAM %d] Established DTLS connection", streamID)
deps.log().Debugf("[STREAM %d] Established DTLS connection", streamID)
if err := clientsdb.WriteClientID(dtlsConn, params.ClientID); err != nil {
return fmt.Errorf("failed to write client ID: %w", err)