GCC Middle and Back End API Reference
|
#include <analyzer-logging.h>
Public Member Functions | |
log_scope (logger *logger, const char *name) | |
log_scope (logger *logger, const char *name, const char *fmt,...) ATTRIBUTE_GCC_DIAG(4 | |
~log_scope () | |
Private Member Functions | |
DISABLE_COPY_AND_ASSIGN (log_scope) | |
Private Attributes | |
logger * | m_logger |
const char * | m_name |
The class log_scope is an RAII-style class intended to make it easy to notify a logger about entering and exiting the body of a given function.
|
inline |
The constructor for log_scope. The normal case is that the logger is NULL, in which case this should be largely a no-op. If we do have a logger, notify it that we're entering the given scope. We also need to hold a reference on it, to avoid a use-after-free when logging the cleanup of the owner of the logger.
References ana::logger::enter_scope(), ana::logger::incref(), m_logger, and m_name.
|
inline |
References ap, ana::logger::enter_scope(), ana::logger::incref(), m_logger, and m_name.
|
inline |
The destructor for log_scope; essentially the opposite of the constructor.
References ana::logger::decref(), ana::logger::exit_scope(), m_logger, and m_name.
|
private |
|
private |
Referenced by log_scope(), log_scope(), and ~log_scope().
|
private |
Referenced by log_scope(), log_scope(), and ~log_scope().