Log disk not found error just once (#6059)

Modified the LogIf function to log only if the error passed
is not on the ignored errors list.

Currently, only disk not found error is added to the list.
Added a new function in logger package called LogAlwaysIf, 
which will print on any error.

Fixes #5997
This commit is contained in:
kannappanr
2018-08-14 13:58:48 -07:00
committed by Harshavardhana
parent ff29aed05d
commit 0286e61aee
7 changed files with 29 additions and 13 deletions

View File

@@ -428,7 +428,6 @@ func writeUniqueXLMetadata(ctx context.Context, disks []StorageAPI, bucket, pref
// Start writing `xl.json` to all disks in parallel.
for index, disk := range disks {
if disk == nil {
logger.LogIf(ctx, errDiskNotFound)
mErrs[index] = errDiskNotFound
continue
}
@@ -467,7 +466,6 @@ func writeSameXLMetadata(ctx context.Context, disks []StorageAPI, bucket, prefix
// Start writing `xl.json` to all disks in parallel.
for index, disk := range disks {
if disk == nil {
logger.LogIf(ctx, errDiskNotFound)
mErrs[index] = errDiskNotFound
continue
}