Changeset c8af4b31a3f9b713f944d3c71e60bf1a666f1088

Show
Ignore:
Timestamp:
01/30/09 17:12:19 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1233335539 +0000
git-parent:

[5d557e747257b9a91c7870bfda3448f767b74f14]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1233335539 +0000
Message:

This is a hack, refs #87.

I don't like the way this is done. The problem here is that the log
log string is fixated for the first log stream and output vectors
use their own. So, you get all or nothing and can't debug at lower
tiers.

Ideally, the log API must change to accept (time, file, line) for
all the writes. That way they can do what they like with it and
we can create a maintainer/debug logger that brings crazy detailed
information.

We only have a few loggers now, it should be very easy.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_conf.c

    r057e0c6 rc8af4b3  
    663663    noit_hash_table *config; 
    664664    noit_boolean disabled; 
     665    noit_boolean debug; 
    665666 
    666667    if(!noit_conf_get_stringbuf(log_configs[i], 
     
    694695      ls->enabled = 0; 
    695696       
     697    if(noit_conf_get_boolean(log_configs[i], 
     698                             "ancestor-or-self::node()/@debug", 
     699                             &debug) && debug) 
     700      ls->debug = 1; 
     701       
    696702    outlets = noit_conf_get_sections(log_configs[i], 
    697703                                     "ancestor-or-self::node()/outlet", &ocnt); 
  • src/utils/noit_log.c

    r7422acb rc8af4b3  
    337337  int rv = 0, allocd = 0; 
    338338  char buffer[4096], *dynbuff = NULL; 
     339  char fbuf[1024]; 
    339340#ifdef va_copy 
    340341  va_list copy; 
     
    343344  if(ls->enabled) { 
    344345    int len; 
     346    if(ls->debug) { 
     347      struct tm _tm, *tm = &_tm; 
     348      char tbuf[32]; 
     349      time_t s = (time_t)now->tv_sec; 
     350      tm = localtime_r(&s, &_tm); 
     351      strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm); 
     352      snprintf(fbuf, sizeof(fbuf), "[%s.%06d %s:%d] %s", 
     353               tbuf, now->tv_usec, file, line, format); 
     354      format = fbuf; 
     355    } 
    345356#ifdef va_copy 
    346357    va_copy(copy, arg); 
  • src/utils/noit_log.h

    r7422acb rc8af4b3  
    2727  char *type; 
    2828  char *name; 
    29   int enabled; 
     29  int enabled:1; 
     30  int debug:1; 
    3031  char *path; 
    3132  logops_t *ops;