Changeset 57:ff8f8dee0f98 in rrlib_logging


Ignore:
Timestamp:
01.06.2011 14:50:25 (9 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Convert:
svn:2179b62a-598e-4714-ba03-d8986cbf34aa/trunk@65
Message:

Bugfix

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • definitions.h

    r56 r57  
    115115    
    116116#define RRLIB_LOG_STREAM_CALL_STATIC(level, args...) \ 
    117   ((level) <= RRLIB_LOG_GET_DOMAIN(args)->GetMaxMessageLevel() ? RRLIB_LOG_GET_DOMAIN(args)->GetMessageStream("<static>", __FUNCTION__, __FILE__, __LINE__, level).Evaluate(args) : RRLIB_LOG_GET_DOMAIN(args)->GetMessageStream(GetLogDescription(), __FUNCTION__, __FILE__, __LINE__, level)) \ 
     117  ((level) <= RRLIB_LOG_GET_DOMAIN(args)->GetMaxMessageLevel() ? RRLIB_LOG_GET_DOMAIN(args)->GetMessageStream("<static>", __FUNCTION__, __FILE__, __LINE__, level).Evaluate(args) : RRLIB_LOG_GET_DOMAIN(args)->GetMessageStream("<static>", __FUNCTION__, __FILE__, __LINE__, level)) \ 
    118118    
    119119#define RRLIB_LOG_MESSAGE_CALL(level, args...) \ 
  • test/test_messages.cpp

    r43 r57  
    9494} 
    9595 
     96struct TestStatic 
     97{ 
     98  const char *GetLogDescription() 
     99  { 
     100    return "TestStatic"; 
     101  } 
     102 
     103  static void StaticMethod() 
     104  { 
     105    RRLIB_LOG_STREAM_STATIC(eLL_USER, "From static method"); 
     106  } 
     107 
     108  void NonStaticMethod() 
     109  { 
     110    RRLIB_LOG_STREAM(eLL_USER, "From non-static method"); 
     111  } 
     112}; 
     113 
    96114 
    97115int main(int argc, char **argv) 
     
    150168  std::copy(&texts[0], &texts[0] + 5, std::ostream_iterator<const char*>(RRLIB_LOG_STREAM(eLL_DEBUG), " ")); 
    151169 
     170  TestStatic test_static; 
     171  test_static.StaticMethod(); 
     172  test_static.NonStaticMethod(); 
     173 
    152174  return EXIT_SUCCESS; 
    153175} 
Note: See TracChangeset for help on using the changeset viewer.