From 4c43aeea176b3384bc9430df5c73427b94c3adb3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Mar 2013 17:38:48 +0100 Subject: [PATCH] Bug 8190: raise an error if the Log::LogLite module is not installed Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy --- C4/Context.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 0fdfddf..944c36b 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -20,7 +20,10 @@ use strict; use warnings; use vars qw($VERSION $AUTOLOAD $context @context_stack $servers $memcached $ismemcached); -use Koha::Utils::Logger; +eval{ + require Koha::Utils::Logger; +}; +die "The logging system is broken. Please check that Log::LogLite is installed." if $@; BEGIN { if ($ENV{'HTTP_USER_AGENT'}) { @@ -1239,7 +1242,7 @@ sub logger my $sth; if ( defined( $context->{"logger"} ) ) { - return $context->{"logger"}; + return $context->{"logger"}; } $context->{"logger"} = Koha::Utils::Logger->new( -- 2.1.0