libqi-api  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Functions
log.hxx File Reference

Go to the source code of this file.

Classes

class  qi::log::LogStream
 Each log macro creates a LogStream object. More...
 

Namespaces

 qi
 qi general namespace
 
 qi::log
 Log functions with different levels of verbosity.
 
 qi::log::detail
 

Macros

#define _QI_DETAILS_LOG_HXX_
 
#define _qiLogDebug(...)   qi::log::LogStream(qi::LogLevel_Debug, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _qiLogVerbose(...)   qi::log::LogStream(qi::LogLevel_Verbose, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _qiLogInfo(...)   qi::log::LogStream(qi::LogLevel_Info, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _qiLogWarning(...)   qi::log::LogStream(qi::LogLevel_Warning, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _qiLogError(...)   qi::log::LogStream(qi::LogLevel_Error, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _qiLogFatal(...)   qi::log::LogStream(qi::LogLevel_Fatal, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()
 
#define _QI_FORMAT_ELEM(_, a, elem)   % (elem)
 
#define _QI_LOG_FORMAT(Msg,...)   QI_CAT(_QI_LOG_FORMAT_HASARG_, _QI_LOG_ISEMPTY(__VA_ARGS__))(Msg, __VA_ARGS__)
 
#define _QI_LOG_FORMAT_HASARG_0(Msg,...)   boost::str(::qi::log::detail::getFormat(Msg) QI_VAARGS_APPLY(_QI_FORMAT_ELEM, _, __VA_ARGS__ ))
 
#define _QI_LOG_FORMAT_HASARG_1(Msg,...)   Msg
 
#define _QI_SECOND(a,...)   __VA_ARGS__
 
#define _QI_LOG_CATEGORY_GET()   _qi_log_category
 
#define _QI_LOG_MESSAGE(Type, Message)
 
#define _QI_LOG_MESSAGE_STREAM(Type, TypeCased,...)   QI_CAT(_QI_LOG_MESSAGE_STREAM_HASCAT_, _QI_LOG_ISEMPTY( __VA_ARGS__))(Type, TypeCased, __VA_ARGS__)
 
#define _QI_LOG_MESSAGE_STREAM_HASCAT_1(Type, TypeCased,...)
 
#define _QI_LOG_MESSAGE_STREAM_HASCAT_0(...)   _QI_LOG_MESSAGE_STREAM_HASCAT_0_BOUNCE(__VA_ARGS__)
 
#define _QI_LOG_MESSAGE_STREAM_HASCAT_0_BOUNCE(Type, TypeCased, cat,...)   QI_CAT(_QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_, _QI_LOG_ISEMPTY( __VA_ARGS__))(Type, TypeCased, cat, __VA_ARGS__)
 
#define _QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_1(Type, TypeCased, cat,...)   BOOST_PP_CAT(_qiLog,TypeCased)(cat)
 
#define _QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_0(Type, TypeCased, cat,...)   BOOST_PP_CAT(_qiLog, TypeCased)(cat, _QI_LOG_FORMAT(__VA_ARGS__))
 
#define _QI_LOG_REVERSE   9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0
 
#define _QI_LOG_REVERSEEMPTY   0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1
 
#define _QI_LOG_ARGN(a, b, c, d, e, f, g, h, i, N,...)   N
 
#define _QI_LOG_NARG_(dummy,...)   _QI_LOG_ARGN(__VA_ARGS__)
 
#define _QI_LOG_NARG(...)   _QI_LOG_NARG_(dummy, ##__VA_ARGS__, _QI_LOG_REVERSE)
 
#define _QI_LOG_ISEMPTY(...)   _QI_LOG_NARG_(dummy, ##__VA_ARGS__, _QI_LOG_REVERSEEMPTY)
 

Typedefs

typedef detail::Category * qi::log::CategoryType
 

Functions

bool qi::log::detail::qiFalse ()
 
bool qi::log::detail::operator< (bool b, const NullStream &ns)
 
boost::format qi::log::detail::getFormat (const std::string &s)
 
bool qi::log::detail::isVisible (Category *category, qi::LogLevel level)
 

Macro Definition Documentation

#define _QI_DETAILS_LOG_HXX_

Definition at line 9 of file log.hxx.

#define _QI_FORMAT_ELEM (   _,
  a,
  elem 
)    % (elem)

Definition at line 49 of file log.hxx.

#define _QI_LOG_ARGN (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  N,
  ... 
)    N

Definition at line 140 of file log.hxx.

#define _QI_LOG_CATEGORY_GET ( )    _qi_log_category

Definition at line 65 of file log.hxx.

#define _QI_LOG_FORMAT (   Msg,
  ... 
)    QI_CAT(_QI_LOG_FORMAT_HASARG_, _QI_LOG_ISEMPTY(__VA_ARGS__))(Msg, __VA_ARGS__)

Definition at line 51 of file log.hxx.

#define _QI_LOG_FORMAT_HASARG_0 (   Msg,
  ... 
)    boost::str(::qi::log::detail::getFormat(Msg) QI_VAARGS_APPLY(_QI_FORMAT_ELEM, _, __VA_ARGS__ ))

Definition at line 54 of file log.hxx.

#define _QI_LOG_FORMAT_HASARG_1 (   Msg,
  ... 
)    Msg

Definition at line 57 of file log.hxx.

#define _QI_LOG_ISEMPTY (   ...)    _QI_LOG_NARG_(dummy, ##__VA_ARGS__, _QI_LOG_REVERSEEMPTY)

Definition at line 143 of file log.hxx.

#define _QI_LOG_MESSAGE (   Type,
  Message 
)
Value:
do \
{ \
::qi::log::log(::qi::Type, \
Message, \
__FILE__, __FUNCTION__, __LINE__); \
} \
while (false)
void log(const qi::LogLevel verb, const char *category, const char *msg, const char *file="", const char *fct="", const int line=0)
Log function. You should call qiLog* macros instead.
#define _QI_LOG_CATEGORY_GET()
Definition: log.hxx:65
bool isVisible(Category *category, qi::LogLevel level)
Definition: log.hxx:204

Definition at line 79 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM (   Type,
  TypeCased,
  ... 
)    QI_CAT(_QI_LOG_MESSAGE_STREAM_HASCAT_, _QI_LOG_ISEMPTY( __VA_ARGS__))(Type, TypeCased, __VA_ARGS__)

Definition at line 95 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM_HASCAT_0 (   ...)    _QI_LOG_MESSAGE_STREAM_HASCAT_0_BOUNCE(__VA_ARGS__)

Definition at line 107 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM_HASCAT_0_BOUNCE (   Type,
  TypeCased,
  cat,
  ... 
)    QI_CAT(_QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_, _QI_LOG_ISEMPTY( __VA_ARGS__))(Type, TypeCased, cat, __VA_ARGS__)

Definition at line 111 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM_HASCAT_1 (   Type,
  TypeCased,
  ... 
)
Value:
&& BOOST_PP_CAT(_qiLog, TypeCased)(_QI_LOG_CATEGORY_GET())
#define _QI_LOG_CATEGORY_GET()
Definition: log.hxx:65
bool isVisible(Category *category, qi::LogLevel level)
Definition: log.hxx:204

Definition at line 99 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_0 (   Type,
  TypeCased,
  cat,
  ... 
)    BOOST_PP_CAT(_qiLog, TypeCased)(cat, _QI_LOG_FORMAT(__VA_ARGS__))

Definition at line 120 of file log.hxx.

#define _QI_LOG_MESSAGE_STREAM_HASCAT_HASFORMAT_1 (   Type,
  TypeCased,
  cat,
  ... 
)    BOOST_PP_CAT(_qiLog,TypeCased)(cat)

Definition at line 116 of file log.hxx.

#define _QI_LOG_NARG (   ...)    _QI_LOG_NARG_(dummy, ##__VA_ARGS__, _QI_LOG_REVERSE)

Definition at line 142 of file log.hxx.

#define _QI_LOG_NARG_ (   dummy,
  ... 
)    _QI_LOG_ARGN(__VA_ARGS__)

Definition at line 141 of file log.hxx.

#define _QI_LOG_REVERSE   9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0

Definition at line 138 of file log.hxx.

#define _QI_LOG_REVERSEEMPTY   0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1

Definition at line 139 of file log.hxx.

#define _QI_SECOND (   a,
  ... 
)    __VA_ARGS__

Definition at line 59 of file log.hxx.

#define _qiLogDebug (   ...)    qi::log::LogStream(qi::LogLevel_Debug, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 15 of file log.hxx.

#define _qiLogError (   ...)    qi::log::LogStream(qi::LogLevel_Error, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 39 of file log.hxx.

#define _qiLogFatal (   ...)    qi::log::LogStream(qi::LogLevel_Fatal, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 45 of file log.hxx.

#define _qiLogInfo (   ...)    qi::log::LogStream(qi::LogLevel_Info, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 27 of file log.hxx.

#define _qiLogVerbose (   ...)    qi::log::LogStream(qi::LogLevel_Verbose, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 21 of file log.hxx.

#define _qiLogWarning (   ...)    qi::log::LogStream(qi::LogLevel_Warning, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__).self()

Definition at line 33 of file log.hxx.