]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC.pm
Merge branch 'upstream'
[maypole.git] / lib / Apache / MVC.pm
index 0dba642b9cdb2237fd623c5da5f8ce6f3b324246..db2bbed641fec4f064b405764f518b6ba4f7cd3f 100644 (file)
@@ -27,6 +27,7 @@ BEGIN {
      }
      require Apache2::RequestIO;
      require Apache2::RequestRec;
+     use Apache2::Log;
      require Apache2::RequestUtil;
      eval 'use Apache2::Const -compile => qw/REDIRECT/;'; # -compile 4 no import
      require APR::URI;
@@ -116,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;
 }