From 7988bf4796a63c0fa233e7b462b58612cc90bb42 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 2 Apr 2017 22:02:29 +0200 Subject: Extract logger setup into method Signed-off-by: Florian Pritz --- script/borg-restore.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'script') 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 -- cgit v1.2.3-24-g4f1b