When an error occurs and perl dies, the provided error messages now
will be handled/logged by the "Logger" module.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
my $logger = Guardian::Logger->New(%mainsettings);
$logger->Log("debug", "Logger successfully initialized...");
+# Redirect perls "die" messages to the logger before exiting.
+$SIG{__DIE__} = sub { $logger->Log("err", "@_"); };
+
# Shared hash between the main process and all threads. It will store all
# monitored files and their current file position.
my %monitored_files :shared = ();