Changeset 2467


Ignore:
Timestamp:
Feb 19, 2009, 4:45:14 PM (15 years ago)
Author:
Christoph Mayer
Message:

-logging farben über ./configure --enable-logcolors=yes einschaltbar, sonst per default ausgeschalten
-alls std::cout auskommentiert

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r2411 r2467  
    1515AC_ARG_ENABLE(doxygen, [  --enable-doxygen      Enable doxygen documentation ], enable_doxygen=$enableval, enable_doxygen=no)
    1616AM_CONDITIONAL(DOXYGEN, test "$enable_doxygen" = yes)
     17
     18AC_ARG_ENABLE(logcolors, [  --enable-logcolors  Enable colorful logging], enable_logcolors=$enableval, enable_logcolors=no)
     19AM_CONDITIONAL(LOGCOLORS, test "$enable_logcolors" = yes)
    1720
    1821AC_PROG_LIBTOOL
  • source/ariba/AribaModule.cpp

    r2454 r2467  
    132132        }
    133133
    134         std::cout << "added bootstrap info: " << getBootstrapHints() << std::endl;
     134        //std::cout << "added bootstrap info: " << getBootstrapHints() << std::endl;
    135135}
    136136
  • source/ariba/Makefile.am

    r2461 r2467  
    3535if OMNET
    3636AM_CPPFLAGS    += -fPIC -DUNDERLAY_OMNET
     37endif
     38
     39if LOGCOLORS
     40AM_CPPFLAGS    += -DLOGCOLORS
    3741endif
    3842
  • source/ariba/communication/modules/transport/protlib/logfile.cpp

    r2466 r2467  
    119119  if (logstream && !quiet)
    120120  {
    121     (*logstream) << color[blue] << timenow() << '[' << getpid() << "] Redirecting Log output to \"" << filename << '\"' << endl;
    122     (*logstream) << color[blue] << timenow()
    123                  << '[' << getpid() << "] <<<<<<<<<<<<<<<<<<<<<<<< *** LOG  STOP *** <<<<<<<<<<<<<<<<<<<<<<<<"
    124                  << color[off] << endl;
     121//     (*logstream) << color[blue] << timenow() << '[' << getpid() << "] Redirecting Log output to \"" << filename << '\"' << endl;
     122//     (*logstream) << color[blue] << timenow()
     123//               << '[' << getpid() << "] <<<<<<<<<<<<<<<<<<<<<<<< *** LOG  STOP *** <<<<<<<<<<<<<<<<<<<<<<<<"
     124//               << color[off] << endl;
    125125  }
    126126
     
    144144  else
    145145  {
    146     (*logstream) << color[blue] << timenow()
    147                  << '[' << getpid() << "] >>>>>>>>>>>>>>>>>>>>>>>> *** LOG START *** >>>>>>>>>>>>>>>>>>>>>>>>"
    148                  << color[off] << endl;
     146//     (*logstream) << color[blue] << timenow()
     147//               << '[' << getpid() << "] >>>>>>>>>>>>>>>>>>>>>>>> *** LOG START *** >>>>>>>>>>>>>>>>>>>>>>>>"
     148//               << color[off] << endl;
    149149  }
    150150  return true;
  • source/ariba/communication/modules/transport/protlib/logfile.h

    r2466 r2467  
    3131
    3232
    33 //#define _NO_LOGGING
     33#define _NO_LOGGING
    3434
    3535#include <fstream> // file stream
     
    243243    if (!quiet_start && logstream)
    244244    {
    245       (*logstream) << color[blue] << timenow()
    246                    << '[' << getpid() << "] >>>>>>>>>>>>>>>>>>>>>>>> *** LOG START *** >>>>>>>>>>>>>>>>>>>>>>>>"
    247                    << color[off] << endl;
     245//       (*logstream) << color[blue] << timenow()
     246//                 << '[' << getpid() << "] >>>>>>>>>>>>>>>>>>>>>>>> *** LOG START *** >>>>>>>>>>>>>>>>>>>>>>>>"
     247//                 << color[off] << endl;
    248248    }
    249249    pthread_mutex_unlock(&logmutex);
     
    260260
    261261    if ( ! quiet_start )
    262         (*logstream) << color[blue] << timenow() << '[' << getpid()
    263         << "] <<<<<<<<<<<<<<<<<<<<<<<< *** LOG  STOP *** <<<<<<<<<<<<<<<<<<<<<<<<"
    264         << color[off] << endl;
     262//      (*logstream) << color[blue] << timenow() << '[' << getpid()
     263//      << "] <<<<<<<<<<<<<<<<<<<<<<<< *** LOG  STOP *** <<<<<<<<<<<<<<<<<<<<<<<<"
     264//      << color[off] << endl;
    265265    pthread_mutex_unlock(&logmutex);
    266266
  • source/ariba/communication/modules/transport/tcp/TCPTransport.cpp

    r2466 r2467  
    314314
    315315                // send message
    316                 cout << "Sending message ..." << endl;
     316                //cout << "Sending message ..." << endl;
    317317                sendMessage( new TextMessage( "Hello World!" ) );
    318                 cout << "Message sent ..." << endl;
     318                //cout << "Message sent ..." << endl;
    319319
    320320        }
  • source/ariba/communication/modules/transport/tcp/TCPTransport.h

    r2466 r2467  
    4141
    4242// kill protlib logging
    43 //#define _NO_LOGGING
     43#define _NO_LOGGING
    4444
    4545#include "ariba/utility/logging/Logging.h"
  • source/ariba/utility/logging/Logging.h

    r2455 r2467  
    4545#include <log4cxx/basicconfigurator.h>
    4646
    47 #define colorDefault { std::cout << "\033[0m";  } /*reset*/
    48 #define colorDebug   { std::cout << "\033[31m"; } /*gray*/
    49 #define colorInfo    { std::cout << "\033[32m"; } /*green*/
    50 #define colorWarn    { std::cout << "\033[34m"; } /*blue*/
    51 #define colorError   { std::cout << "\033[31m"; } /*red*/
     47#ifdef LOGCOLORS
     48
     49  #define colorDefault { std::cout << "\033[0m";  } /*reset*/
     50  #define colorDebug   { std::cout << "\033[33m"; } /*cyan*/
     51  #define colorInfo    { std::cout << "\033[32m"; } /*green*/
     52  #define colorWarn    { std::cout << "\033[34m"; } /*blue*/
     53  #define colorError   { std::cout << "\033[31m"; } /*red*/
     54
     55#else
     56
     57  #define colorDefault { }
     58  #define colorDebug   { }
     59  #define colorInfo    { }
     60  #define colorWarn    { }
     61  #define colorError   { }
     62
     63#endif // ENABLE_LOGCOLORS
    5264
    5365#define use_logging_h(x) \
     
    5769        log4cxx::LoggerPtr x::logger(log4cxx::Logger::getLogger(#x));
    5870
    59 #define logging_trace(x)  {            LOG4CXX_TRACE(logger,x);              }
    60 #define logging_debug(x)  {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault;}
    61 #define logging_info(x)   {colorInfo;  LOG4CXX_INFO(logger,x);  colorDefault;}
    62 #define logging_warn(x)   {colorWarn;  LOG4CXX_WARN(logger,x);  colorDefault;}
    63 #define logging_error(x)  {colorError; LOG4CXX_ERROR(logger,x); colorDefault;}
    64 #define logging_fatal(x)  {colorError; LOG4CXX_FATAL(logger,x); exit(-1);    }
     71#define logging_trace(x)  {            LOG4CXX_TRACE(logger,x);                         }
     72#define logging_debug(x)  {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault;           }
     73#define logging_info(x)   {colorInfo;  LOG4CXX_INFO(logger,x);  colorDefault;           }
     74#define logging_warn(x)   {colorWarn;  LOG4CXX_WARN(logger,x);  colorDefault;           }
     75#define logging_error(x)  {colorError; LOG4CXX_ERROR(logger,x); colorDefault;           }
     76#define logging_fatal(x)  {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); }
    6577
    6678#endif //LOGGING_H__
  • source/ariba/utility/messages/MessageReceiver.cpp

    r2466 r2467  
    5050
    5151bool MessageReceiver::receiveMessage( const Message* message, const LinkID& link, const NodeID& node ) {
    52         std::cout << "UNIMPLEMENTED MessageReceiver got Message:" << (Message*)message << std::endl;
     52        //std::cout << "UNIMPLEMENTED MessageReceiver got Message:" << (Message*)message << std::endl;
    5353        return false;
    5454}
  • source/ariba/utility/system/Timer.cpp

    r2466 r2467  
    8989
    9090void Timer::eventFunction() {
    91         std::cout << "Timer(" << millis << ")" << std::endl;
     91        //std::cout << "unimplemented eventFunction Timer(" << millis << ")" << std::endl;
    9292}
    9393
Note: See TracChangeset for help on using the changeset viewer.