perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/docs/2.0/user/handlers server.pod
Date Sat, 11 Jan 2003 05:43:40 GMT
stas        2003/01/10 21:43:40

  Modified:    src/docs/2.0/user/handlers server.pod
  Log:
  update the logging example to gracefully handle the case when the log file
  is not open
  
  Revision  Changes    Path
  1.3       +8 -1      modperl-docs/src/docs/2.0/user/handlers/server.pod
  
  Index: server.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/server.pod,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- server.pod	17 Nov 2002 05:28:40 -0000	1.2
  +++ server.pod	11 Jan 2003 05:43:40 -0000	1.3
  @@ -90,7 +90,14 @@
     
     sub say {
         my($caller) = (caller(1))[3] =~ /([^:]+)$/;
  -      printf $log_fh "[%s] - %-11s: %s\n", scalar(localtime), $caller, $_[0];
  +      if (defined $log_fh) {
  +          printf $log_fh "[%s] - %-11s: %s\n", 
  +              scalar(localtime), $caller, $_[0];
  +      }
  +      else {
  +          # when the log file is not open
  +          warn __PACKAGE__ . " says: $_[0]\n";
  +      }
     }
     
     END {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message