Changeset 83:12592a6223ba in rrlib_logging


Ignore:
Timestamp:
18.01.2012 18:36:27 (8 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Transplant:
0e282797c67292b0b845d4930371ea2cb24f85a0
Message:

Readded some important optimization steps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • messages.h

    r81 r83  
    6666//---------------------------------------------------------------------- 
    6767#define __RRLIB_LOG_PRINT__(domain, level, args...) \ 
    68   rrlib::logging::Print(domain, GetLogDescription(), __FUNCTION__, __FILE__, __LINE__, level, args); 
     68  do \ 
     69  { \ 
     70    if ((level) <= domain.MaxMessageLevel()) \ 
     71    { \ 
     72      rrlib::logging::Print(domain, GetLogDescription(), __FUNCTION__, __FILE__, __LINE__, level, args); \ 
     73    } \ 
     74  } while(0) \ 
    6975 
    7076#define __RRLIB_LOG_PRINT_STATIC__(domain, level, args...) \ 
    71   rrlib::logging::Print(domain, "<static>", __FUNCTION__, __FILE__, __LINE__, level, args); 
     77  do \ 
     78  { \ 
     79    if ((level) <= domain.MaxMessageLevel()) \ 
     80    { \ 
     81      rrlib::logging::Print(domain, "<static>", __FUNCTION__, __FILE__, __LINE__, level, args); \ 
     82    } \ 
     83  } while(0) \ 
    7284 
    7385#define __RRLIB_LOG_PRINTF__(domain, level, args...) \ 
    74   rrlib::logging::PrintFormatted(domain, GetLogDescription(), __FUNCTION__, __FILE__, __LINE__, level, args); 
     86  do \ 
     87  { \ 
     88    if ((level) <= domain.MaxMessageLevel()) \ 
     89        { \ 
     90      rrlib::logging::PrintFormatted(domain, GetLogDescription(), __FUNCTION__, __FILE__, __LINE__, level, args); \ 
     91    } \ 
     92  } while(0) \ 
    7593 
    7694#define __RRLIB_LOG_PRINTF_STATIC__(domain, level, args...) \ 
    77   rrlib::logging::PrintFormatted(domain, "<static>", __FUNCTION__, __FILE__, __LINE__, level, args); 
     95  do \ 
     96  { \ 
     97    if ((level) <= domain.MaxMessageLevel()) \ 
     98    { \ 
     99      rrlib::logging::PrintFormatted(domain, "<static>", __FUNCTION__, __FILE__, __LINE__, level, args); \ 
     100    } \ 
     101  } while(0) \ 
    78102 
    79103//---------------------------------------------------------------------- 
     
    95119    } \ 
    96120  } while (0) \ 
    97       
     121 
    98122/*! Macro to print messages to explicitly specified domain using stream semantics 
    99123 * 
     
    110134    } \ 
    111135  } while (0) \ 
    112       
     136 
    113137/*! Macro to print messages using stream semantics from static context 
    114138 * 
     
    124148    } \ 
    125149  } while (0) \ 
    126       
     150 
    127151/*! Macro to print messages to explicitly specified domain using stream semantics from static context 
    128152 * 
     
    139163    } \ 
    140164  } while (0) \ 
    141       
     165 
    142166/*! Macro to print messages using printf semantics 
    143167 * 
     
    153177    } \ 
    154178  } while (0) \ 
    155       
     179 
    156180/*! Macro to print messages to explicitly specified domain using printf semantics 
    157181 * 
     
    168192    } \ 
    169193  } while (0) \ 
    170       
     194 
    171195/*! Macro to print messages using printf semantics from static context 
    172196 * 
     
    182206    } \ 
    183207  } while (0) \ 
    184       
     208 
    185209/*! Macro to print messages to explicitly specified domain using printf semantics from static context 
    186210 * 
     
    197221    } \ 
    198222  } while (0) \ 
    199       
     223 
    200224#else 
    201225 
     
    207231#define RRLIB_LOG_PRINT(level, args...) \ 
    208232  __RRLIB_LOG_PRINT__(rrlib::logging::GetConfiguration(__FILE__), level, args) \ 
    209     
     233 
    210234/*! Macro to print messages to explicitly specified domain using stream semantics 
    211235 * 
     
    216240#define RRLIB_LOG_PRINT_TO(domain, level, args...) \ 
    217241  __RRLIB_LOG_PRINT__(rrlib::logging::GetConfiguration(__FILE__, #domain), level, args) \ 
    218     
     242 
    219243/*! Macro to print messages using stream semantics static context 
    220244 * 
     
    224248#define RRLIB_LOG_PRINT_STATIC(level, args...) \ 
    225249  __RRLIB_LOG_PRINT_STATIC__(rrlib::logging::GetConfiguration(__FILE__), level, args) \ 
    226     
     250 
    227251/*! Macro to print messages to explicitly specified using stream semantics static context 
    228252 * 
     
    233257#define RRLIB_LOG_PRINT_STATIC_TO(domain, level, args...) \ 
    234258  __RRLIB_LOG_PRINT_STATIC__(rrlib::logging::GetConfiguration(__FILE__, #domain), level, args) \ 
    235     
     259 
    236260/*! Macro to print messages using printf semantics 
    237261 * 
     
    241265#define RRLIB_LOG_PRINTF(level, args...) \ 
    242266  __RRLIB_LOG_PRINTF__(rrlib::logging::GetConfiguration(__FILE__), level, args) \ 
    243     
     267 
    244268/*! Macro to print messages to explicitly specified using printf semantics 
    245269 * 
     
    250274#define RRLIB_LOG_PRINTF_TO(domain, level, args...) \ 
    251275  __RRLIB_LOG_PRINTF__(rrlib::logging::GetConfiguration(__FILE__, #domain), level, args) \ 
    252     
     276 
    253277/*! Macro to print messages using printf semantics from static context 
    254278 * 
     
    258282#define RRLIB_LOG_PRINTF_STATIC(level, args...) \ 
    259283  __RRLIB_LOG_PRINTF_STATIC__(rrlib::logging::GetConfiguration(__FILE__), level, args) \ 
    260     
     284 
    261285/*! Macro to print messages to explicitly specified using printf semantics from static context 
    262286 * 
     
    267291#define RRLIB_LOG_PRINTF_STATIC_TO(domain, level, args...) \ 
    268292  __RRLIB_LOG_PRINTF_STATIC__(rrlib::logging::GetConfiguration(__FILE__, #domain), level, args) \ 
    269     
     293 
    270294#endif 
    271295 
Note: See TracChangeset for help on using the changeset viewer.