The Micro C++ Library
include/micxx/Log.hxx File Reference

Declaration of class micxx::Log and the logging macros MICXX_DEBUG(level,expr), MICXX_INFO(expr), MICXX_WARN(expr) and MICXX_ERROR(expr). More...

#include <micxx/Config.hxx>
#include <micxx/traits/NonCopyable.hxx>
#include <micxx/System.hxx>
#include <micxx/Synchronized.hxx>
#include <iostream>
#include <fstream>

Classes

class  micxx::Log
 The class Log provides a simple logging facility. More...

Namespaces

namespace  micxx
 

The Micro C++ Library.


Defines

#define MICXX_LOG(cat, catname, expr)
 This macro is only used internally and should not be used directly.
#define MICXX_DEBUG(level, expr)   if (level<micxx::Log::debugLevel) MICXX_LOG(debug, " [DEBUG] ", expr)
#define MICXX_INFO(expr)   MICXX_LOG(info , " [ INFO] ", expr)
#define MICXX_WARN(expr)   MICXX_LOG(warn , " [ WARN] ", expr)
#define MICXX_ERROR(expr)   MICXX_LOG(error, " [ERROR] ", expr)
#define MICXX_NORMAL   0
#define MICXX_VERBOSE   1
#define MICXX_TRACE   2
#define MICXX_PRIVATE   8
#define MICXX_PRIVATE_IO   9

Detailed Description

Declaration of class micxx::Log and the logging macros MICXX_DEBUG(level,expr), MICXX_INFO(expr), MICXX_WARN(expr) and MICXX_ERROR(expr).


Define Documentation

#define MICXX_DEBUG (   level,
  expr 
)    if (level<micxx::Log::debugLevel) MICXX_LOG(debug, " [DEBUG] ", expr)
#define MICXX_ERROR (   expr)    MICXX_LOG(error, " [ERROR] ", expr)
#define MICXX_INFO (   expr)    MICXX_LOG(info , " [ INFO] ", expr)
#define MICXX_LOG (   cat,
  catname,
  expr 
)
Value:
do{if(micxx::Log::cat!=0){                                                     \
    micxx::Synchronized synchronized(micxx::Log::mutex);                       \
    *(micxx::Log::cat) << micxx::System::getTime()                             \
                       << catname << expr                                      \
                       << " " << __FILE__ << "(" << __LINE__ << ") "           \
                       << std::endl;                                           \
    micxx::Log::cat->flush();}}while(0)

This macro is only used internally and should not be used directly.

#define MICXX_NORMAL   0

The logging expr will be emitted, if system property debug is true.

#define MICXX_PRIVATE   8

The logging expr will be emitted, if system property debug is true and debug.level is greater @ 8.

Note:
This is reserved for Micro C++ internal logging only.
#define MICXX_PRIVATE_IO   9

The logging expr will be emitted, if system property debug is true and debug.level is greater @ 9.

Note:
This is reserved for Micro C++ internal logging only and will result in a vast amount of output.
#define MICXX_TRACE   2

The logging expr will be emitted, if system property debug is true and debug.level is greater @ 2.

#define MICXX_VERBOSE   1

The logging expr will be emitted, if system property debug is true and debug.level is greater @ 1.

#define MICXX_WARN (   expr)    MICXX_LOG(warn , " [ WARN] ", expr)