You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
.gitignore | 3 years ago | |
LICENSE | 4 years ago | |
README.md | 3 years ago | |
go.mod | 4 years ago | |
log.go | 2 years ago |
README.md
log
A simple log primative Open Privacy uses
Examples:
log.AddEverythingFromPattern("connectivity")
log.SetLevel(log.LevelDebug)
log.ExcludeFromPattern("connection/connection")
log.ExcludeFromPattern("outbound/3dhauthchannel")
log.AddPrivacyFilter(func(s string) bool {
return len(s) == 56
})
log.SetPrivacyFilterReplace(true)
log.Debugf("Creating the thing with param %v\n", param)
log.Infoln("Doing thing X")
log.Warnf("This might be bad: %v\n", err)
log.Errorf("Failed to do thing: %v\n", err)
Making log go to a file
if runtime.GOOS == "windows" {
filelogger, err := log.NewFile(log.LevelInfo, "cwtch_log.txt")
if err == nil {
log.SetStd(filelogger)
}
}