Changeset 9737


Ignore:
Timestamp:
Apr 7, 2011, 4:36:00 PM (14 years ago)
Author:
Christoph Mayer
Message:

-logging optional

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bootstrap_libs

    r9662 r9737  
    88
    99# apache runtime
    10 wget http://apache.linux-mirror.org/apr/apr-1.4.2.tar.gz
    11 tar xvvzf apr-1.4.2.tar.gz
    12 cd apr-1.4.2
    13 ./configure --prefix=$PREFIX
    14 make && make install
    15 cd ..
     10#wget http://apache.linux-mirror.org/apr/apr-1.4.2.tar.gz
     11#tar xvvzf apr-1.4.2.tar.gz
     12#cd apr-1.4.2
     13#./configure --prefix=$PREFIX
     14#make && make install
     15#cd ..
    1616
    1717# apache runtime utilities
    18 wget http://apache.linux-mirror.org/apr/apr-util-1.3.10.tar.gz
    19 tar xvvzf apr-util-1.3.10.tar.gz
    20 cd apr-util-1.3.10
    21 ./configure --prefix=$PREFIX --with-apr=$PREFIX
    22 make && make install
    23 cd ..
     18#wget http://apache.linux-mirror.org/apr/apr-util-1.3.10.tar.gz
     19#tar xvvzf apr-util-1.3.10.tar.gz
     20#cd apr-util-1.3.10
     21#./configure --prefix=$PREFIX --with-apr=$PREFIX
     22#make && make install
     23#cd ..
    2424
    2525# log4cxx
    26 wget http://ftp.uni-erlangen.de/pub/mirrors/apache/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
    27 cp ../etc/patch/apache-log4cxx-0.10.0.diff ./
    28 tar xvvzf apache-log4cxx-0.10.0.tar.gz
    29 patch -p0 <apache-log4cxx-0.10.0.diff
    30 cd apache-log4cxx-0.10.0
    31 ./configure --prefix=$PREFIX --with-apr=$PREFIX --with-apr-util=$PREFIX
    32 make && make install
    33 cd ..
     26#wget http://ftp.uni-erlangen.de/pub/mirrors/apache/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
     27#cp ../etc/patch/apache-log4cxx-0.10.0.diff ./
     28#tar xvvzf apache-log4cxx-0.10.0.tar.gz
     29#patch -p0 <apache-log4cxx-0.10.0.diff
     30#cd apache-log4cxx-0.10.0
     31#./configure --prefix=$PREFIX --with-apr=$PREFIX --with-apr-util=$PREFIX
     32#make && make install
     33#cd ..
    3434
    3535# boost 1.39.0
  • source/ariba/utility/logging/Logging.h

    r7748 r9737  
    4545
    4646#ifdef HAVE_LOG4CXX_LOGGER_H
    47 #include <log4cxx/logger.h>
    48 #include <log4cxx/basicconfigurator.h>
     47        #include <log4cxx/logger.h>
     48        #include <log4cxx/basicconfigurator.h>
    4949#endif // HAVE_LOG4CXX_LOGGER_H
    5050
    5151#ifdef LOGCOLORS
    52 
    5352  #define colorDefault { std::cout << "\033[0m";  } /*reset*/
    5453  #define colorDebug   { std::cout << "\033[0;33m"; } /*cyan*/
     
    5857
    5958#else
    60 
    6159  #define colorDefault { }
    6260  #define colorDebug   { }
     
    6462  #define colorWarn    { }
    6563  #define colorError   { }
    66 
    6764#endif // ENABLE_LOGCOLORS
    6865
     
    8380  #define logging_fatal(x)  {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); }
    8481
     82  #define logging_rootlevel_debug()       {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getDebug()); }
     83  #define logging_rootlevel_info()        {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getInfo() ); }
     84  #define logging_rootlevel_warn()        {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getWarn() ); }
     85  #define logging_rootlevel_error()       {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getError()); }
     86
     87  #define logging_classlevel_debug(x) {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getDebug()); }
     88  #define logging_classlevel_info(x)  {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getInfo());  }
     89  #define logging_classlevel_warn(x)  {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getWarn());  }
     90  #define logging_classlevel_error(x) {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getError()); }
     91
    8592#else // HAVE_LOG4CXX_LOGGER_H
    8693
    8794  #define use_logging_h(x)
    88 
    8995  #define use_logging_cpp(x)
    9096
    9197  #define logging_stdout(x) std::cout << x << std::endl;
    9298
    93   #define logging_trace(x)
    94   #define logging_debug(x)  {colorDebug; logging_stdout(x); colorDefault;           }
    95   #define logging_info(x)   {colorInfo;  logging_stdout(x);  colorDefault;           }
    96   #define logging_warn(x)   {colorWarn;  logging_stdout(x);  colorDefault;           }
    97   #define logging_error(x)  {colorError; logging_stdout(x); colorDefault;           }
    98   #define logging_fatal(x)  {colorError; logging_stdout(x); colorDefault; exit(-1); }
     99  static int __loglevel__ = 2; //default is info
     100
     101  #define logging_trace(x)  {            logging_stdout(x);                         }
     102  #define logging_debug(x)  {if(__loglevel__ <= 1){ colorDebug; logging_stdout(x); colorDefault; }}
     103  #define logging_info(x)   {if(__loglevel__ <= 2){ colorInfo;  logging_stdout(x); colorDefault; }}
     104  #define logging_warn(x)   {if(__loglevel__ <= 3){ colorWarn;  logging_stdout(x); colorDefault; }}
     105  #define logging_error(x)  {                     return; colorError; logging_stdout(x); colorDefault;           }
     106  #define logging_fatal(x)  {                     return; colorError; logging_stdout(x); colorDefault; exit(-1); }
     107
     108  #define logging_rootlevel_debug()       {__loglevel__ = 1;}
     109  #define logging_rootlevel_info()        {__loglevel__ = 2;}
     110  #define logging_rootlevel_warn()        {__loglevel__ = 3;}
     111  #define logging_rootlevel_error()       {__loglevel__ = 4;}
     112
     113  #define logging_classlevel_debug(x) {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
     114  #define logging_classlevel_info(x)  {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
     115  #define logging_classlevel_warn(x)  {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
     116  #define logging_classlevel_error(x) {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
    99117
    100118#endif // HAVE_LOG4CXX_LOGGER_H
  • source/ariba/utility/system/StartupWrapper.cpp

    r7916 r9737  
    4141
    4242#ifdef HAVE_LOG4CXX_LOGGER_H
    43 #include <log4cxx/logger.h>
    44 #include <log4cxx/basicconfigurator.h>
     43        #include <log4cxx/logger.h>
     44        #include <log4cxx/basicconfigurator.h>
    4545#endif // HAVE_LOG4CXX_LOGGER_H
    4646
     
    9696        // init the logging system
    9797        //
    98         // configure the logging
    99         //
    100        
     98
    10199#ifdef HAVE_LOG4CXX_LOGGER_H
    102100        log4cxx::BasicConfigurator::configure();
     101#endif //HAVE_LOG4CXX_LOGGER_H
    103102
    104         // set the global log level to warning
    105         {
    106                 log4cxx::LoggerPtr logger(log4cxx::Logger::getRootLogger());
    107                 logger->setLevel(log4cxx::Level::getInfo());
    108         }
     103        //
     104        // configure the default logging level to info
     105        //
    109106
    110         // set up again an individual level if you like
    111 #ifndef HAVE_MAEMO
    112         {
    113                 //log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("MCPO"));
    114                 //logger->setLevel(log4cxx::Level::getDebug());
    115         }
    116 #endif //HAVE_MAEMO
    117 #endif //HAVE_LOG4CXX_LOGGER_H
     107        logging_rootlevel_info();
    118108}
    119109
Note: See TracChangeset for help on using the changeset viewer.