Skip to content

Secrets

Michael Kenney edited this page Aug 13, 2018 · 1 revision

bdlm/log supports a "blacklist" of values that should not be logged. This can be used to help prevent or mitigate leaking secrets into log files:

import (
    "github.com/bdlm/log"
)

func main() {
    log.AddSecret("some-secret-text")
    log.Info("the secret is 'some-secret-text'")

    // Output: the secret is '****************'
}