Implement parsing browser requests and sending errors (#9)

This commit is contained in:
Maxim Baz
2018-04-14 12:49:03 +02:00
committed by GitHub
parent 60a4a1ddaa
commit 42e6157238
10 changed files with 192 additions and 28 deletions

View File

@@ -11,11 +11,9 @@ import (
// AddPersistentLogHook configures persisting logs in syslog
func AddPersistentLogHook() {
hook, err := logSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "browserpass")
if err == nil {
log.AddHook(hook)
if hook, err := logSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "browserpass"); err != nil {
log.Warn("Unable to connect to syslog, logs will NOT be persisted: ", err)
} else {
log.Warn("Unable to connect to syslog, logs will NOT be persisted")
log.AddHook(hook)
}
}

View File

@@ -19,7 +19,7 @@ func AddPersistentLogHook() {
}
logFolderPath := filepath.Join(appDataPath, "browserpass")
if err := os.MkdirAll(logFolderPath, os.ModePerm); err != nil {
log.Warn("Unable to create browserpass folder in %%APPDATA%%, logs will NOT be persisted")
log.Warn("Unable to create browserpass folder in %%APPDATA%%, logs will NOT be persisted: ", err)
return
}
logFilePath := filepath.Join(logFolderPath, "browserpass.log")