X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FApache%2FMVC.pm;h=db2bbed641fec4f064b405764f518b6ba4f7cd3f;hb=ccffaddb7564c652448befe4d67d0ae5276d8975;hp=84fbd2124aeebbf2d07bc965a677f8e01523d51e;hpb=1a0c0da3e5794de7e691dbcf7f2c1cbdf8f31317;p=maypole.git diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 84fbd21..db2bbed 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -27,7 +27,7 @@ BEGIN { } require Apache2::RequestIO; require Apache2::RequestRec; - require Apache2::Log; + use Apache2::Log; require Apache2::RequestUtil; eval 'use Apache2::Const -compile => qw/REDIRECT/;'; # -compile 4 no import require APR::URI; @@ -117,9 +117,15 @@ sub warn { my ($package, $line) = (caller)[0,2]; my $ar = $self->parent ? $self->parent->{ar} : $self->{ar}; if ( $args[0] and ref $self ) { + my @lines = split /\n/, (join '', @args); + $ar->warn("[$package line $line] ".shift(@lines)); + foreach(@lines) { + next unless $_; + $ar->warn(" $_"); + } $ar->warn("[$package line $line] ", @args) ; } else { - print "warn called by ", caller, " with ", @_, "\n"; + print STDERR "warn called by ", caller, " with ", @_, "\n"; } return; }