diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-04-02 22:02:29 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-04-02 22:31:49 +0200 |
commit | 7988bf4796a63c0fa233e7b462b58612cc90bb42 (patch) | |
tree | 50891ec0f5c6eeeff9e5c14a97d26b48c3df7db0 /script | |
parent | 4c84b1a04348e317ef2b9e014e4bd06bfc6d8cf2 (diff) | |
download | App-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-x | script/borg-restore.pl | 6 |
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 |