Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract ObscureSensitiveParams function #4

Open
alessandroargentieri opened this issue Apr 14, 2021 · 0 comments
Open

extract ObscureSensitiveParams function #4

alessandroargentieri opened this issue Apr 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@alessandroargentieri
Copy link
Member

Now you can enable or disable the ObscureSensitiveData functionality whose check is applied to all log records when enabled.
It slows down the execution time even when you log a simple record.
Extract and make ObscureSensitiveParam public, in order to give the possibility to choose to disable the functionality and using it only when needed.
This could be done this way:

log.SetConfig{ &log.Configs{
         ObscureSensitiveData: log.Disable,
         SensitiveParams: []string{"password"},
     }
}

And then:

log.Info(log.ObscureSensitiveData(myrecord))

This way the feature remains disabled by default but used only when needed.

@alessandroargentieri alessandroargentieri added the enhancement New feature or request label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant