noodlog
noodlog copied to clipboard
extract ObscureSensitiveParams function
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.