Navigation


Changeset 965:9b37f34c1b1f in freeDiameter for libfdproto


Ignore:
Timestamp:
Mar 13, 2013, 1:23:37 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Some modifications to logging code:

  • Added a FD_LOG_NOTICE level for the logger function
  • Separated the internal debug levels (NONE, INFO, ...) from the "printlevel" for the logger
  • Renamed TRACE_DEBUG_ERROR to TRACE_ERROR for symetry
  • Renamed TRACE_DEBUG_BUFFER and TRACE_DEBUG_sSA. There take now the printlevel as parameter
  • Added new TRACE_NOTICE, fd_log_notice and fd_log_error macros.
  • sorry if I forgot some changes...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/log.c

    r961 r965  
    9595
    9696    /* add timestamp */
    97     fprintf(fd_g_debug_fstr, "%s\t", fd_log_time(NULL, buf, sizeof(buf)));
     97    fprintf(fd_g_debug_fstr, "%s  ", fd_log_time(NULL, buf, sizeof(buf)));
     98    switch(loglevel) {
     99            case FD_LOG_DEBUG:  fprintf(fd_g_debug_fstr, " DBG   "); break;
     100            case FD_LOG_NOTICE: fprintf(fd_g_debug_fstr, "NOTI   "); break;
     101            case FD_LOG_ERROR:  fprintf(fd_g_debug_fstr, "ERROR  "); break;
     102            default:            fprintf(fd_g_debug_fstr, " ???   ");
     103    }
    98104    vfprintf(fd_g_debug_fstr, format, ap);
    99105    if (format && (format[strlen(format)-1] != '\n')) {
Note: See TracChangeset for help on using the changeset viewer.