logging: Replace functions by native equivalents

This commit is contained in:
Tom Wiesing 2023-03-13 13:19:32 +01:00
parent 4fc937841a
commit d7847b5d69
No known key found for this signature in database
10 changed files with 28 additions and 40 deletions

View file

@ -2,12 +2,11 @@ package exporter
import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"time"
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
)
// ShouldPrune determines if a file with the provided modification time should be
@ -45,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())
logging.ProgressF(progress, ctx, "Removing %s cause it is older than %d days\n", path, exporter.Config.MaxBackupAge)
fmt.Fprintf(progress, "Removing %s cause it is older than %d days\n", path, exporter.Config.MaxBackupAge)
if err := os.Remove(path); err != nil {
return err