perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@locus.apache.org
Subject cvs commit: modperl-2.0/src/modules/perl modperl_log.c modperl_log.h
Date Sat, 15 Apr 2000 01:38:24 GMT
dougm       00/04/14 18:38:24

  Added:       src/modules/perl modperl_log.c modperl_log.h
  Log:
  get tracing stuff in place
  
  Revision  Changes    Path
  1.1                  modperl-2.0/src/modules/perl/modperl_log.c
  
  Index: modperl_log.c
  ===================================================================
  #include "mod_perl.h"
  
  U32 MP_debug_level = 0;
  
  void modperl_trace(char *func, const char *fmt, ...)
  {
      va_list args;
  
      if (func) {
          fprintf(stderr, "%s: ", func);
      }
  
      va_start(args, fmt);
      vfprintf(stderr, fmt, args);
      va_end(args);
  }
  
  void modperl_trace_level_set(char *level)
  {
      if (!level) {
          if (!(level = getenv("MOD_PERL_TRACE"))) {
              return;
          }
      }
      
      if (strEQ(level, "all")) {
          MP_debug_level = 0xffffffff;
      }
      else if (isALPHA(level[0])) {
          static char debopts[] = "dshgc";
          char *d;
  
          for (; *level && (d = strchr(debopts, *level)); level++) {
              MP_debug_level |= 1 << (d - debopts);
          }
      }
      else {
          MP_debug_level = atoi(level);
      }
  
      MP_debug_level |= 0x80000000;
  }
  
  
  
  1.1                  modperl-2.0/src/modules/perl/modperl_log.h
  
  Index: modperl_log.h
  ===================================================================
  #ifndef MODPERL_LOG_H
  #define MODPERL_LOG_H
  
  #define MP_TRACE /* XXX: make optional */
  
  #define MP_FUNC __FUNCTION__ /* XXX: not every cc supports this
                                * sort out later
                                */
  
  #include "modperl_trace.h"
  
  void modperl_trace(char *func, const char *fmt, ...);
  
  void modperl_trace_level_set(char *level);
  
  #endif /* MODPERL_LOG_H */
  
  
  

Mime
View raw message