Spicy
Public Member Functions | Protected Member Functions | Friends | List of all members
hilti::Logger Class Reference

#include <logger.h>

Public Member Functions

 Logger (std::ostream &output_std=std::cerr, std::ostream &output_debug=std::cerr)
 
void log (logging::Level level, const std::string &msg, const Location &l=location::None)
 
void info (const std::string &msg, const Location &l=location::None)
 
void warning (const std::string &msg, const Location &l=location::None)
 
void deprecated (const std::string &msg, const Location &l=location::None)
 
void error (const std::string &msg, const Location &l=location::None)
 
void error (const std::string &msg, const std::vector< std::string > &context, const Location &l=location::None)
 
void fatalError (const std::string &msg, const Location &l=location::None) __attribute__((noreturn))
 
void internalError (const std::string &msg, const Location &l=location::None) __attribute__((noreturn))
 
void _debug (const logging::DebugStream &dbg, const std::string &msg, const Location &l=location::None)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void log (std::string msg, const T &n)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void info (std::string msg, const T &n)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void warning (std::string msg, const T &n)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void error (std::string msg, const T &n)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void error (std::string msg, std::vector< std::string > context, const T &n)
 
template<typename R , typename T , IF_DERIVED_FROM(T, trait::isNode) >
void error (Result< R > r, const T &n)
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
 __attribute__ ((noreturn)) void fatalError(std
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
 __attribute__ ((noreturn)) void internalError(std
 
template<typename T , IF_DERIVED_FROM(T, trait::isNode) >
void debug (const logging::DebugStream &dbg, std::string msg, const T &n)
 
void debugEnable (const logging::DebugStream &dbg)
 
bool debugEnable (const std::string &dbg)
 
void debugDisable (const logging::DebugStream &dbg)
 
bool debugDisable (const std::string &dbg)
 
bool isEnabled (const logging::DebugStream &dbg)
 
void debugPushIndent (const logging::DebugStream &dbg)
 
void debugPopIndent (const logging::DebugStream &dbg)
 
void debugSetIndent (const logging::DebugStream &dbg, size_t indent)
 
int errors () const
 
int warnings () const
 
void reset ()
 

Protected Member Functions

void report (std::ostream &output, logging::Level level, size_t indent, const std::string &addl, const std::string &msg, const Location &l) const
 

Friends

Loggerlogger ()
 
std::unique_ptr< LoggersetLogger (std::unique_ptr< Logger > logger)
 

Detailed Description

Logging system.

Member Function Documentation

◆ _debug()

void Logger::_debug ( const logging::DebugStream dbg,
const std::string &  msg,
const Location l = location::None 
)

Use HILTI_DEBUG(...) instead.

Friends And Related Function Documentation

◆ logger

Logger& logger ( )
friend

Returns the global logger. A default logger singleton is created at startup. A custom logger can be set through setLogger().

◆ setLogger

std::unique_ptr<Logger> setLogger ( std::unique_ptr< Logger logger)
friend

Sets a new logger as the global singleton. Returns the previous one.


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