mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
Enhance Log Output from Permanent Delete (#9044)
use structured logging Missed Structured Log Using Err for Errors in Structured Logging
This commit is contained in:
committed by
Christopher Speller
parent
f57d279dc0
commit
efa954622c
+17
-5
@@ -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),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user