Update logging behavior

This commit is contained in:
Tom Wiesing 2022-12-01 12:42:04 +01:00
parent 3b78b06fff
commit 6f1ba24761
No known key found for this signature in database
28 changed files with 176 additions and 137 deletions

View file

@ -2,10 +2,11 @@ package exporter
import (
"context"
"fmt"
"io"
"path/filepath"
"time"
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
)
// ShouldPrune determines if a file with the provided modification time should be
@ -43,7 +44,7 @@ func (exporter *Exporter) PruneExports(ctx context.Context, progress io.Writer)
// assemble path, and then remove the file!
path := filepath.Join(sPath, entry.Name())
fmt.Fprintf(progress, "Removing %s cause it is older than %d days\n", path, exporter.Config.MaxBackupAge)
logging.ProgressF(progress, ctx, "Removing %s cause it is older than %d days\n", path, exporter.Config.MaxBackupAge)
if err := exporter.Still.Environment.Remove(path); err != nil {
return err