12 #ifndef ZYPP_BASE_LOGGER_H 13 #define ZYPP_BASE_LOGGER_H 27 BlockTraceBase(
const char * file_r,
const char * fnc_r,
int line_r, std::string msg_r=std::string() )
31 ,
_msg { std::move(msg_r) }
46 BlockTrace(
const char * file_r,
const char * fnc_r,
int line_r, std::string msg_r=std::string() );
51 #define BLOCKTRACE(M) ::zypp::debug::BlockTrace _BlockTrace( L_BASEFILE, __FUNCTION__, __LINE__, M ) 65 TraceLeave(
const char * file_r,
const char * fnc_r,
int line_r, std::string msg_r=std::string() );
70 #define TRACE(M) ::zypp::debug::TraceLeave _TraceLeave( __FILE__, __FUNCTION__, __LINE__, M ); 71 #define XTRACE ::zypp::debug::TraceLeave _TraceLeave( __FILE__, __FUNCTION__, __LINE__ ); 76 Osd( std::ostream &,
int = 0 );
82 _strout << std::forward<Tp>(val);
83 _strlog << std::forward<Tp>(val);
87 Osd &
operator<<( std::ostream& (*iomanip)( std::ostream& ) );
95 #define OSD ::zypp::debug::getOSD() 123 #ifndef ZYPP_BASE_LOGGER_LOGGROUP 125 #define ZYPP_BASE_LOGGER_LOGGROUP "DEFINE_LOGGROUP" 128 #define XXX L_XXX( ZYPP_BASE_LOGGER_LOGGROUP ) 129 #define DBG L_DBG( ZYPP_BASE_LOGGER_LOGGROUP ) 130 #define MIL L_MIL( ZYPP_BASE_LOGGER_LOGGROUP ) 131 #define WAR L_WAR( ZYPP_BASE_LOGGER_LOGGROUP ) 132 #define ERR L_ERR( ZYPP_BASE_LOGGER_LOGGROUP ) 133 #define SEC L_SEC( ZYPP_BASE_LOGGER_LOGGROUP ) 134 #define INT L_INT( ZYPP_BASE_LOGGER_LOGGROUP ) 135 #define USR L_USR( ZYPP_BASE_LOGGER_LOGGROUP ) 137 #define L_XXX(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_XXX ) 138 #define L_DBG(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP"++", zypp::base::logger::E_MIL ) 139 #define L_MIL(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_MIL ) 140 #define L_WAR(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_WAR ) 141 #define L_ERR(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_ERR ) 142 #define L_SEC(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_SEC ) 143 #define L_INT(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_INT ) 144 #define L_USR(GROUP) ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_USR ) 147 #define L_ENV_CONSTR_DEFINE_FUNC(ENV) \ 148 namespace zypp::log { \ 149 bool has_env_constr_##ENV () \ 151 static bool has_##ENV = (::getenv(#ENV) != NULL); \ 154 const char *empty_or_group_if_##ENV ( const char *group ) \ 156 return has_env_constr_##ENV() ? group : nullptr; \ 160 #define L_ENV_CONSTR_FWD_DECLARE_FUNC(ENV) namespace zypp::log { bool has_env_constr_##ENV (); const char *empty_or_group_if_##ENV ( const char *group ); } 161 #define L_ENV_CONSTR(ENV,GROUP,LEVEL) ZYPP_BASE_LOGGER_LOG( zypp::log::empty_or_group_if_##ENV( GROUP ), LEVEL ) 163 #define L_BASEFILE ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ ) 166 #define ZYPP_BASE_LOGGER_LOG(GROUP,LEVEL) \ 167 zypp::base::logger::getStream( GROUP, LEVEL, L_BASEFILE, __FUNCTION__, __LINE__ ) 207 extern std::ostream &
getStream(
const char * group_r,
224 #endif // ZYPP_BASE_LOGGER_H
Osd & operator<<(Tp &&val)
LogLevel
Definition of log levels.
BlockTraceBase(const BlockTraceBase &)=delete
BlockTraceBase & operator=(const BlockTraceBase &)=delete
std::ostream & operator<<(std::ostream &str, TraceCADBase::What obj)
relates: TraceCADBase Stream output of TraceCADBase::What.
BlockTraceBase(const char *file_r, const char *fnc_r, int line_r, std::string msg_r=std::string())
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Provides API related macros.
BlockTrace(const BlockTrace &)=delete
BlockTrace & operator=(const BlockTrace &)=delete
std::ostream & getStream(const char *group_r, LogLevel level_r, const char *file_r, const char *func_r, const int line_r)
Return a log stream to write on.
Easy-to use interface to the ZYPP dependency resolver.