Navigation


Changeset 1407:d4a4ab5239c7 in freeDiameter


Ignore:
Timestamp:
Feb 18, 2020, 3:01:07 PM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

add log level FD_LOG_INFO

Add log level FD_LOG_INFO, below FD_LOG_NOTICE and above FD_LOG_DEBUG.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • freeDiameterd/main.c

    r1389 r1407  
    6969
    7070        switch (loglevel) {
     71        case FD_LOG_INFO:
     72                level = LOG_INFO;
     73                break;
    7174        case FD_LOG_NOTICE:
    7275                level = LOG_NOTICE;
  • include/freeDiameter/libfdproto.h

    r1393 r1407  
    271271#define FD_LOG_ANNOYING  0  /* very verbose loops and such "overkill" traces. Only active when the framework is compiled in DEBUG mode. */
    272272#define FD_LOG_DEBUG     1  /* Get a detailed sense of what is going on in the framework. Use this level for normal debug */
     273#define FD_LOG_INFO      2  /* Informational execution states */
    273274#define FD_LOG_NOTICE    3  /* Normal execution states worth noting */
    274275#define FD_LOG_ERROR     5  /* Recoverable or expected error conditions */
     
    330331#define LOG_D(format,args... ) \
    331332                LOG(FD_LOG_DEBUG, format, ##args)
     333
     334/* Report an info message */
     335#define LOG_I(format,args... ) \
     336                LOG(FD_LOG_INFO, format,##args)
    332337
    333338/* Report a normal message that is useful for normal admin monitoring */
     
    517522                if ((__l__ = TRACE_BOOL(oldlevel))) {                                   \
    518523                        if      (oldlevel <= NONE) { LOG_E(format,##args); }            \
    519                         else if (oldlevel <= INFO) { LOG_N(format,##args); }            \
     524                        else if (oldlevel <= INFO) { LOG_I(format,##args); }            \
    520525                        else if (__l__ == 2)       { LOG_N(format,##args); }            \
    521526                        else if (oldlevel <= FULL) { LOG_D(format,##args); }            \
     
    596601#ifdef STRIP_DEBUG_CODE
    597602#undef LOG_D
     603#undef LOG_I
    598604#undef LOG_N
    599605#undef LOG_E
     
    602608
    603609#define LOG_D(format,args... ) /* noop */
     610#define LOG_I(format,args...) fd_log(FD_LOG_INFO, format, ## args)
    604611#define LOG_N(format,args...) fd_log(FD_LOG_NOTICE, format, ## args)
    605612#define LOG_E(format,args...) fd_log(FD_LOG_ERROR, format, ## args)
  • libfdproto/log.c

    r1305 r1407  
    113113            case FD_LOG_ANNOYING:  printf("%s   A   ", (use_colors == 1) ? "\e[0;37m" : ""); break;
    114114            case FD_LOG_DEBUG:     printf("%s DBG   ", (use_colors == 1) ? "\e[0;37m" : ""); break;
     115            case FD_LOG_INFO:      printf("%sINFO   ", (use_colors == 1) ? "\e[1;37m" : ""); break;
    115116            case FD_LOG_NOTICE:    printf("%sNOTI   ", (use_colors == 1) ? "\e[1;37m" : ""); break;
    116117            case FD_LOG_ERROR:     printf("%sERROR  ", (use_colors == 1) ? "\e[0;31m" : ""); break;
Note: See TracChangeset for help on using the changeset viewer.