googleapis / googleapis/google-cloud-go

logging: add logger minimal severity

Open
#6,345 0 comments 0 reactions 1 assignee Assigned to @daniel-sanche View on GitHub
api: logging priority: p2 type: feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.