libzypp: zypp-core/base/Logger.h File Reference

libzypp 17.38.10

Logger.h File Reference
`#include <cstring>`
`#include <iosfwd>`
`#include <string>`
`#include <zypp-core/Globals.h>`

Go to the source code of this file.

## Classes
struct | zypp::debug::TraceLeave
struct | zypp::debug::Osd

## Namespaces
namespace | zypp
| Easy-to use interface to the ZYPP dependency resolver.
namespace | zypp::debug
namespace | zypp::base
namespace | zypp::base::logger

## Macros
#define | TRACE(M)
#define | XTRACE ::zypp::debug::TraceLeave _TraceLeave( __FILE__, __FUNCTION__, __LINE__ );
#define | OSD ::zypp::debug::getOSD()
#define | ZYPP_BASE_LOGGER_LOGGROUP "DEFINE_LOGGROUP"
| Default log group if undefined.
#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)
#define | L_DBG(GROUP)
#define | L_MIL(GROUP)
#define | L_WAR(GROUP)
#define | L_ERR(GROUP)
#define | L_SEC(GROUP)
#define | L_INT(GROUP)
#define | L_USR(GROUP)
#define | L_ENV_CONSTR_DEFINE_FUNC(ENV)
#define | L_ENV_CONSTR_FWD_DECLARE_FUNC(ENV)
#define | L_ENV_CONSTR(ENV, GROUP, LEVEL)
#define | L_BASEFILE ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ )
#define | ZYPP_BASE_LOGGER_LOG(GROUP, LEVEL)
| Actual call to getStream.

## Enumerations
enum | zypp::base::logger::LogLevel { zypp::base::logger::E_XXX = 999 , zypp::base::logger::E_DBG = 0 , zypp::base::logger::E_MIL , zypp::base::logger::E_WAR , zypp::base::logger::E_ERR , zypp::base::logger::E_SEC , zypp::base::logger::E_INT , zypp::base::logger::E_USR }
| Definition of log levels. More...

## Functions
Osd & | zypp::debug::getOSD ()
std::ostream & | zypp::base::logger::getStream (const char *group_r, LogLevel level_r, const char *file_r, const char *func_r, const int line_r) ZYPP_API
| Return a log stream to write on.
bool | zypp::base::logger::isExcessive ()

## Macro Definition Documentation

## ◆ TRACE

#define TRACE | ( |  | M | ) |

Value:
::zypp::debug::TraceLeave _TraceLeave( __FILE__, __FUNCTION__, __LINE__, M );
zypp::debug::TraceLeave
Definition Logger.h:30

Definition at line 42 of file Logger.h.

## ◆ XTRACE

#define XTRACE ::zypp::debug::TraceLeave _TraceLeave( __FILE__, __FUNCTION__, __LINE__ );

Definition at line 43 of file Logger.h.

## ◆ OSD

#define OSD ::zypp::debug::getOSD()

Definition at line 68 of file Logger.h.

## ◆ ZYPP_BASE_LOGGER_LOGGROUP

#define ZYPP_BASE_LOGGER_LOGGROUP "DEFINE_LOGGROUP"

Default log group if undefined.

Definition at line 98 of file Logger.h.

## ◆ XXX

#define XXX L_XXX( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 101 of file Logger.h.

## ◆ DBG

#define DBG L_DBG( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 102 of file Logger.h.

## ◆ MIL

#define MIL L_MIL( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 103 of file Logger.h.

## ◆ WAR

#define WAR L_WAR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 104 of file Logger.h.

## ◆ ERR

#define ERR L_ERR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 105 of file Logger.h.

## ◆ SEC

#define SEC L_SEC( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 106 of file Logger.h.

## ◆ INT

#define INT L_INT( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 107 of file Logger.h.

## ◆ USR

#define USR L_USR( ZYPP_BASE_LOGGER_LOGGROUP )

Definition at line 108 of file Logger.h.

## ◆ L_XXX

#define L_XXX | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_XXX )
ZYPP_BASE_LOGGER_LOG
#define ZYPP_BASE_LOGGER_LOG(GROUP, LEVEL)
Actual call to getStream.
Definition Logger.h:139
zypp::base::logger::E_XXX
@ E_XXX
Excessive logging.
Definition Logger.h:160

Definition at line 110 of file Logger.h.

## ◆ L_DBG

#define L_DBG | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP"++", zypp::base::logger::E_MIL )
zypp::base::logger::E_MIL
@ E_MIL
Milestone.
Definition Logger.h:162

Definition at line 111 of file Logger.h.

## ◆ L_MIL

#define L_MIL | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_MIL )

Definition at line 112 of file Logger.h.

## ◆ L_WAR

#define L_WAR | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_WAR )
zypp::base::logger::E_WAR
@ E_WAR
Warning.
Definition Logger.h:163

Definition at line 113 of file Logger.h.

## ◆ L_ERR

#define L_ERR | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_ERR )
zypp::base::logger::E_ERR
@ E_ERR
Error.
Definition Logger.h:164

Definition at line 114 of file Logger.h.

## ◆ L_SEC

#define L_SEC | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_SEC )
zypp::base::logger::E_SEC
@ E_SEC
Secutrity related.
Definition Logger.h:165

Definition at line 115 of file Logger.h.

## ◆ L_INT

#define L_INT | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_INT )
zypp::base::logger::E_INT
@ E_INT
Internal error.
Definition Logger.h:166

Definition at line 116 of file Logger.h.

## ◆ L_USR

#define L_USR | ( |  | GROUP | ) |

Value:
ZYPP_BASE_LOGGER_LOG( GROUP, zypp::base::logger::E_USR )
zypp::base::logger::E_USR
@ E_USR
User log.
Definition Logger.h:167

Definition at line 117 of file Logger.h.

## ◆ L_ENV_CONSTR_DEFINE_FUNC

#define L_ENV_CONSTR_DEFINE_FUNC | ( |  | ENV | ) |

Value:
namespace zypp::log { \
bool has_env_constr_##ENV () \
{ \
static bool has_##ENV = (::getenv(#ENV) != NULL); \
return has_##ENV; \
} \
const char *empty_or_group_if_##ENV ( const char *group ) \
{ \
return has_env_constr_##ENV() ? group : nullptr; \
} \
}
zypp::log
Definition LogControl.cc:368

Definition at line 120 of file Logger.h.

## ◆ L_ENV_CONSTR_FWD_DECLARE_FUNC

#define L_ENV_CONSTR_FWD_DECLARE_FUNC | ( |  | ENV | ) |

Value:
namespace zypp::log { bool has_env_constr_##ENV (); const char *empty_or_group_if_##ENV ( const char *group ); }

Definition at line 133 of file Logger.h.

## ◆ L_ENV_CONSTR

#define L_ENV_CONSTR | ( |  | ENV,
|  |  | GROUP,
|  |  | LEVEL )

Value:
ZYPP_BASE_LOGGER_LOG( zypp::log::empty_or_group_if_##ENV( GROUP ), LEVEL )

Definition at line 134 of file Logger.h.

## ◆ L_BASEFILE

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

Definition at line 136 of file Logger.h.

## ◆ ZYPP_BASE_LOGGER_LOG

#define ZYPP_BASE_LOGGER_LOG | ( |  | GROUP,
|  |  | LEVEL )

Value:
zypp::base::logger::getStream( GROUP, LEVEL, L_BASEFILE, __FUNCTION__, __LINE__ )
L_BASEFILE
#define L_BASEFILE
Definition Logger.h:136
zypp::base::logger::getStream
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.
Definition LogControl.cc:775

Actual call to getStream.

Definition at line 139 of file Logger.h.