8-Debugging.md

May 27, 2026 · View on GitHub

← Error Handling | Debugging(中文) | Overview →


Debugging

Enable Debug Mode

Debug logs are disabled by default. Enable via WithDebug(true).

config := volcengine.NewConfig().
	WithRegion(region).
	WithDebug(true).
	WithCredentials(credentials.NewEnvCredentials())

Log Output

By default, logs are written to os.Stdout. Use WithLogWriter to write to a file or other writer.

file, _ := os.Create("sdk.log")
config := volcengine.NewConfig().
	WithRegion(region).
	WithDebug(true).
	WithLogWriter(file).
	WithCredentials(credentials.NewEnvCredentials())

← Error Handling | Debugging(中文) | Overview →