From 6abe30a71dbf2938ca8e6efdfa53f0b7f6732d38 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 2 Apr 2017 13:09:18 +0200 Subject: Use logger everywhere in main package Signed-off-by: Florian Pritz --- lib/App/BorgRestore.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/App') diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index a424dff..749f60b 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -124,7 +124,7 @@ sub find_archives { } if (!@ret) { - printf "\e[0;91mWarning:\e[0m Path '%s' not found in any archive.\n", $path; + $log->warningf("Path '%s' not found in any archive.\n", $path); } @ret = sort { $a->{modification_time} <=> $b->{modification_time} } @ret; @@ -139,7 +139,7 @@ sub select_archive_timespec { my $seconds = $self->_timespec_to_seconds($timespec); if (!defined($seconds)) { - say STDERR "Error: Invalid time specification"; + $log->error("Invalid time specification"); return; } @@ -209,7 +209,7 @@ sub restore { $path = App::BorgRestore::Helper::untaint($path, qr(.*)); my $archive_name = App::BorgRestore::Helper::untaint_archive_name($archive->{archive}); - printf "Restoring %s to %s from archive %s\n", $path, $destination, $archive->{archive}; + $log->infof("Restoring %s to %s from archive %s", $path, $destination, $archive->{archive}); my $basename = basename($path); my $components_to_strip =()= $path =~ /\//g; -- cgit v1.2.3-24-g4f1b