GCC Middle and Back End API Reference
diagnostics::logging::logger Class Reference

#include <logging.h>

Collaboration diagram for diagnostics::logging::logger:

Public Member Functions

 logger (output_file outfile)
void log_printf (const char *fmt,...) __attribute__((__format__(printf
void void log_bool_return (const char *function_name, bool retval)
void emit_indent () const
void emit_newline () const
FILE * get_stream () const
int get_indent () const
void inc_depth ()
void dec_depth ()

Private Attributes

output_file m_outfile
int m_log_depth

Detailed Description

A class for emitting a temporal log of what the diagnostics subsystem
is doing, for debugging.
We can't use pretty_printer here as we could potentially be debugging
pretty-printing itself.   

Constructor & Destructor Documentation

◆ logger()

diagnostics::logging::logger::logger ( output_file outfile)

References m_log_depth, and m_outfile.

Member Function Documentation

◆ dec_depth()

void diagnostics::logging::logger::dec_depth ( )
inline

References m_log_depth.

◆ emit_indent()

void diagnostics::logging::logger::emit_indent ( ) const
Emit indentation to OUTFILE for the start of a log line.   

References get_indent(), and get_stream().

Referenced by log_printf().

◆ emit_newline()

void diagnostics::logging::logger::emit_newline ( ) const

References fputc(), and get_stream().

Referenced by log_printf().

◆ get_indent()

int diagnostics::logging::logger::get_indent ( ) const
inline

References m_log_depth.

Referenced by emit_indent().

◆ get_stream()

FILE * diagnostics::logging::logger::get_stream ( ) const
inline

References m_outfile.

Referenced by emit_indent(), emit_newline(), and log_printf().

◆ inc_depth()

void diagnostics::logging::logger::inc_depth ( )
inline

References m_log_depth.

◆ log_bool_return()

void diagnostics::logging::logger::log_bool_return ( const char * function_name,
bool retval )

References function_name(), and log_printf().

◆ log_printf()

void diagnostics::logging::logger::log_printf ( const char * fmt,
... )

Field Documentation

◆ m_log_depth

int diagnostics::logging::logger::m_log_depth
private

◆ m_outfile

output_file diagnostics::logging::logger::m_outfile
private

Referenced by get_stream(), and logger().


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