libzypp  17.3.0
ZYPP_BASE_LOGGER_MACROS

Convenience macros for logging. More...

Macros

#define ZYPP_BASE_LOGGER_LOGGROUP   "DEFINE_LOGGROUP"
 Default log group if undefined. More...
 
#define XXX   L_XXX( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define DBG   L_DBG( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define MIL   L_MIL( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define WAR   L_WAR( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define ERR   L_ERR( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define SEC   L_SEC( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define INT   L_INT( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define USR   L_USR( ZYPP_BASE_LOGGER_LOGGROUP )
 
#define L_XXX(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_XXX )
 
#define L_DBG(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP"++", zypp::base::logger::E_MIL )
 
#define L_MIL(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_MIL )
 
#define L_WAR(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_WAR )
 
#define L_ERR(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_ERR )
 
#define L_SEC(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_SEC )
 
#define L_INT(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_INT )
 
#define L_USR(GROUP)   ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_USR )
 
#define L_BASEFILE   ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ )
 
#define ZYPP_BASE_LOGGER_LOG(GROUP, LEVEL)   zypp::base::logger::getStream( GROUP, LEVEL, L_BASEFILE, __FUNCTION__, __LINE__ )
 Actual call to getStream. More...
 

Detailed Description

Convenience macros for logging.

The macros finaly call getStream, providing appropriate arguments, to return the log stream.

L_DBG("foo") << ....

Logs a debug message for group "foo".

#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "foo"
DBG << ....

Defines group "foo" as default for log messages and logs a debug message.

Macro Definition Documentation

◆ ZYPP_BASE_LOGGER_LOGGROUP

#define ZYPP_BASE_LOGGER_LOGGROUP   "DEFINE_LOGGROUP"

Default log group if undefined.

Definition at line 59 of file Logger.h.

◆ XXX

#define XXX   L_XXX( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 62 of file Logger.h.

◆ DBG

#define DBG   L_DBG( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 63 of file Logger.h.

◆ MIL

#define MIL   L_MIL( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 64 of file Logger.h.

◆ WAR

#define WAR   L_WAR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 65 of file Logger.h.

◆ ERR

#define ERR   L_ERR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 66 of file Logger.h.

◆ SEC

#define SEC   L_SEC( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 67 of file Logger.h.

◆ INT

#define INT   L_INT( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 68 of file Logger.h.

◆ USR

#define USR   L_USR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 69 of file Logger.h.

◆ L_XXX

#define L_XXX (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_XXX )

Definition at line 71 of file Logger.h.

◆ L_DBG

#define L_DBG (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP"++", zypp::base::logger::E_MIL )

Definition at line 72 of file Logger.h.

◆ L_MIL

#define L_MIL (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_MIL )

Definition at line 73 of file Logger.h.

◆ L_WAR

#define L_WAR (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_WAR )

Definition at line 74 of file Logger.h.

◆ L_ERR

#define L_ERR (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_ERR )

Definition at line 75 of file Logger.h.

◆ L_SEC

#define L_SEC (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_SEC )

Definition at line 76 of file Logger.h.

◆ L_INT

#define L_INT (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_INT )

Definition at line 77 of file Logger.h.

◆ L_USR

#define L_USR (   GROUP)    ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_USR )

Definition at line 78 of file Logger.h.

◆ L_BASEFILE

#define L_BASEFILE   ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ )

Definition at line 80 of file Logger.h.

◆ ZYPP_BASE_LOGGER_LOG

#define ZYPP_BASE_LOGGER_LOG (   GROUP,
  LEVEL 
)    zypp::base::logger::getStream( GROUP, LEVEL, L_BASEFILE, __FUNCTION__, __LINE__ )

Actual call to getStream.

Definition at line 83 of file Logger.h.