googleapis / googleapis/google-cloud-go
logging: add logger minimal severity
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 1.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 109
Description
**Problem:**
All logs are sent to the Stackdriver, including debug logs. This is a problem for the security and privacy of logged data. Debug logs may contain sensitive data (for example: credit cards numbers or incoming request auth token).
**Solution:**
I suggest to add logger option `MinimalSeverity` (default value `Default`). `Logger.Log` and `Logger.LogSync` methods compare log entry severity with minimal severity. If entry severity lesser than minimal severity then log entry is ignored.
**Considered alternatives:**
I considered the option of creating my own wrapper over the logger, which would implement the above logic. But this logic is implemented in many well-known logging libraries (for example: zap or logrus), I decided to try to create this issue.
Contributor guide
Assessment
This issue has not been assessed yet.