fix(logs): убрать пострим-шум из лога без debug
TURN urls, персона, попытки кредов и DTLS connect/close - на debug: на 8 стримах это десятки строк на старте.
This commit is contained in:
1 parent
aed2839c7d
commit
c2a9f0f1d7
4 files changed
+8
-8
No files matched your search
@@ -93,7 +93,7 @@ func New(cfg Config) *Client {
|
|||||||
c.identity = browserprofile.Identity{Seed: seed, Gen: c.gens.load(seed)}
|
c.identity = browserprofile.Identity{Seed: seed, Gen: c.gens.load(seed)}
|
||||||
c.persona = browserprofile.For(c.platform, c.identity)
|
c.persona = browserprofile.For(c.platform, c.identity)
|
||||||
if c.identity.Gen > 0 {
|
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
|
return c
|
||||||
}
|
}
|
||||||
@@ -241,11 +241,11 @@ func (c *Client) fetch(ctx context.Context, link string, streamID int) (string,
|
|||||||
jar := personanet.NewCookieJar()
|
jar := personanet.NewCookieJar()
|
||||||
for i := 0; i < len(c.credentials); {
|
for i := 0; i < len(c.credentials); {
|
||||||
creds := c.credentials[i]
|
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)
|
user, pass, addrs, err := c.tokenChain(ctx, link, streamID, creds, jar)
|
||||||
if err == nil {
|
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
|
return user, pass, addrs, nil
|
||||||
}
|
}
|
||||||
lastErr = err
|
lastErr = err
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *Client) getTokenChain(ctx context.Context, link string, streamID int, c
|
|||||||
name := namegen.Generate()
|
name := namegen.Generate()
|
||||||
escapedName := neturl.QueryEscape(name)
|
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 {
|
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)
|
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")
|
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 {
|
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 {
|
for _, u := range urlsRaw {
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ func dtlsSession(dtlsctx context.Context, dtlscancel context.CancelFunc, deps *D
|
|||||||
var dtlsConn net.Conn = dtlsRaw
|
var dtlsConn net.Conn = dtlsRaw
|
||||||
defer func() {
|
defer func() {
|
||||||
_ = dtlsConn.Close()
|
_ = 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 {
|
if err := clientsdb.WriteClientID(dtlsConn, params.ClientID); err != nil {
|
||||||
return fmt.Errorf("failed to write client ID: %w", err)
|
return fmt.Errorf("failed to write client ID: %w", err)
|
||||||
|
|||||||
Reference in new issue
Block a user