summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-04-02 22:02:29 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-04-02 22:31:49 +0200
commit7988bf4796a63c0fa233e7b462b58612cc90bb42 (patch)
tree50891ec0f5c6eeeff9e5c14a97d26b48c3df7db0 /script
parent4c84b1a04348e317ef2b9e014e4bd06bfc6d8cf2 (diff)
downloadApp-BorgRestore-7988bf4796a63c0fa233e7b462b58612cc90bb42.tar.gz
App-BorgRestore-7988bf4796a63c0fa233e7b462b58612cc90bb42.tar.xz
Extract logger setup into method
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'script')
-rwxr-xr-xscript/borg-restore.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/borg-restore.pl b/script/borg-restore.pl
index 1365e2e..48744e4 100755
--- a/script/borg-restore.pl
+++ b/script/borg-restore.pl
@@ -199,7 +199,7 @@ sub user_select_archive {
return ${$archives}[$selection];
}
-sub main {
+sub logger_setup {
my $appender = "Screen";
$appender = "ScreenColoredLevels" if -t STDERR; ## no critic (InputOutput::ProhibitInteractiveTest)
@@ -230,6 +230,10 @@ sub main {
Log::Log4perl->get_logger()->fatal(@_);
exit(2);
};
+}
+
+sub main {
+ logger_setup();
my %opts;
# untaint PATH because we only expect this to run as root