GCC Middle and Back End API Reference
ana::log_user Class Reference

#include <analyzer-logging.h>

Inheritance diagram for ana::log_user:
Collaboration diagram for ana::log_user:

Public Member Functions

 log_user (logger *logger)
 
 ~log_user ()
 
loggerget_logger () const
 
void set_logger (logger *logger)
 
void log (const char *fmt,...) const ATTRIBUTE_GCC_DIAG(2
 
void void start_log_line () const
 
void end_log_line () const
 
void enter_scope (const char *scope_name)
 
void exit_scope (const char *scope_name)
 
pretty_printerget_logger_pp () const
 
FILEget_logger_file () const
 

Private Member Functions

 DISABLE_COPY_AND_ASSIGN (log_user)
 

Private Attributes

loggerm_logger
 

Detailed Description

A log_user is something that potentially uses a logger (which could be NULL).

The log_user class keeps the reference-count of a logger up-to-date.   

Constructor & Destructor Documentation

◆ log_user()

ana::log_user::log_user ( logger * logger)

◆ ~log_user()

ana::log_user::~log_user ( )

Member Function Documentation

◆ DISABLE_COPY_AND_ASSIGN()

ana::log_user::DISABLE_COPY_AND_ASSIGN ( log_user )
private

◆ end_log_line()

void ana::log_user::end_log_line ( ) const
inline
A shortcut for ending a log line from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::end_log_line(), and m_logger.

◆ enter_scope()

void ana::log_user::enter_scope ( const char * scope_name)
inline
A shortcut for recording entry into a scope from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::enter_scope(), ggc_alloc(), and m_logger.

◆ exit_scope()

void ana::log_user::exit_scope ( const char * scope_name)
inline
A shortcut for recording exit from a scope from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::exit_scope(), ggc_alloc(), and m_logger.

◆ get_logger()

logger * ana::log_user::get_logger ( ) const
inline

◆ get_logger_file()

FILE * ana::log_user::get_logger_file ( ) const
inline

◆ get_logger_pp()

pretty_printer * ana::log_user::get_logger_pp ( ) const
inline

◆ log()

void ana::log_user::log ( const char * fmt,
... ) const
inline
A shortcut for calling log from a log_user, handling the common
case where the underlying logger is NULL via a no-op.   

References ap, ggc_alloc(), ana::logger::log_va(), and m_logger.

◆ set_logger()

void ana::log_user::set_logger ( logger * logger)

◆ start_log_line()

void ana::log_user::start_log_line ( ) const
inline
A shortcut for starting a log line from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References m_logger, and ana::logger::start_log_line().

Field Documentation

◆ m_logger


The documentation for this class was generated from the following file: