summaryrefslogtreecommitdiffstats
path: root/app/user.go
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-07-12 16:18:23 +0200
committerChristopher Speller <crspeller@gmail.com>2018-07-12 07:18:23 -0700
commitefa954622ce6e1a50c4cefbcefad06fbde7368bd (patch)
tree83a00b06328ec98586b5013dbaabc15286d09816 /app/user.go
parentf57d279dc0101611e2bd977aef93e32802ff2370 (diff)
downloadchat-efa954622ce6e1a50c4cefbcefad06fbde7368bd.tar.gz
chat-efa954622ce6e1a50c4cefbcefad06fbde7368bd.tar.bz2
chat-efa954622ce6e1a50c4cefbcefad06fbde7368bd.zip
Enhance Log Output from Permanent Delete (#9044)
use structured logging Missed Structured Log Using Err for Errors in Structured Logging
Diffstat (limited to 'app/user.go')
-rw-r--r--app/user.go22
1 files changed, 17 insertions, 5 deletions
diff --git a/app/user.go b/app/user.go
index acd3ee9aa..b9a97b2a9 100644
--- a/app/user.go
+++ b/app/user.go
@@ -1309,16 +1309,28 @@ func (a *App) PermanentDeleteUser(user *model.User) *model.AppError {
res, err := a.FileExists(info.Path)
if err != nil {
- mlog.Warn(fmt.Sprintf("Error checking existence of file '%s': %s", info.Path, err))
+ mlog.Warn(
+ "Error checking existence of file",
+ mlog.String("path", info.Path),
+ mlog.Err(err),
+ )
continue
}
- if res {
- a.RemoveFile(info.Path)
- } else {
- mlog.Warn(fmt.Sprintf("Unable to remove file '%s': %s", info.Path, err))
+ if !res {
+ mlog.Warn("File not found", mlog.String("path", info.Path))
+ continue
}
+ err = a.RemoveFile(info.Path)
+
+ if err != nil {
+ mlog.Warn(
+ "Unable to remove file",
+ mlog.String("path", info.Path),
+ mlog.Err(err),
+ )
+ }
}
}