(much) Less stat calls by caching load_logging

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@844 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2008-02-01 20:59:18 +00:00
parent bc5fd11804
commit 367c9a31a9

View File

@ -28,9 +28,12 @@ sub version { $VERSION };
sub TRACE_LEVEL { $TraceLevel }; # leave for plugin compatibility sub TRACE_LEVEL { $TraceLevel }; # leave for plugin compatibility
my $LOGGING_LOADED = 0;
sub load_logging { sub load_logging {
# need to do this differently that other plugins so as to # need to do this differently that other plugins so as to
# not trigger logging activity # not trigger logging activity
return if $LOGGING_LOADED;
my $self = shift; my $self = shift;
return if $hooks->{"logging"}; return if $hooks->{"logging"};
my $configdir = $self->config_dir("logging"); my $configdir = $self->config_dir("logging");
@ -54,6 +57,8 @@ sub load_logging {
$self->log(LOGINFO, "Loaded $logger"); $self->log(LOGINFO, "Loaded $logger");
} }
$LOGGING_LOADED = 1;
return @loggers; return @loggers;
} }