refactor(auth): Centralize logging for saving credentials

The logic for logging the path where credentials are saved was duplicated across several client implementations.

This commit refactors this behavior by creating a new centralized function, `misc.LogSavingCredentials`, to handle this logging. The `SaveTokenToFile` method in each authentication token storage struct now calls this new function, ensuring consistent logging and reducing code duplication.

The redundant logging statements in the client-level `SaveTokenToFile` methods have been removed.
This commit is contained in:
hkfires
2025-09-19 09:29:31 +08:00
parent 39518ec633
commit 2274d7488b
10 changed files with 80 additions and 20 deletions

View File

@@ -842,7 +842,6 @@ func (c *GeminiWebClient) SaveTokenToFile() error {
}
return ts.SaveTokenToFile(c.tokenFilePath)
}
log.Debugf("Saving Gemini Web cookie snapshot to %s", filepath.Base(util.CookieSnapshotPath(c.tokenFilePath)))
return c.snapshotManager.Persist()
}