Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
Logger Class Reference

#include <Logger.h>

Collaboration diagram for Logger:
Collaboration graph

Public Member Functions

virtual ~Logger ()
 
void _setLogLevel (boost::log::trivial::severity_level severity)
 
void setConsoleLog (bool enableLog)
 
void setFileLog (bool enableLog)
 
bool push (boost::log::trivial::severity_level level, std::ostringstream &stream)
 
void _setListener (void(*cb)(const std::string &))
 
std::ostringstream & pre (std::ostringstream &stream, boost::log::trivial::severity_level lvl)
 
std::ostringstream & aipexceptionPre (std::ostringstream &stream, boost::log::trivial::severity_level lvl, int type)
 
void operator() ()
 

Static Public Member Functions

static void initLogger (LoggerProps props)
 
static LoggergetLogger ()
 
static void setLogLevel (boost::log::trivial::severity_level severity)
 
static bool setLogLevel (const std::string &sSeverity)
 
static void setListener (void(*cb)(const std::string &))
 

Private Member Functions

 Logger (LoggerProps props)
 
void initBoostLogger (LoggerProps props)
 
bool run ()
 
bool process (const std::string &message)
 

Private Attributes

threadsafe_que< std::string > mQue
 
boost::thread myThread
 
bool mRunning
 
LoggerProps mProps
 
void(* mListener )(const std::string &) = nullptr
 
boost::log::sources::severity_logger< boost::log::trivial::severity_level > lg
 
boost::shared_ptr< boost::log::sinks::synchronous_sink< boost::log::sinks::text_ostream_backend > > mConsoleSink
 
boost::shared_ptr< boost::log::sinks::synchronous_sink< boost::log::sinks::text_file_backend > > mFileSink
 

Static Private Attributes

static boost::mutex logger_mutex
 
static boost::shared_ptr< Loggerinstance
 

Constructor & Destructor Documentation

◆ ~Logger()

Logger::~Logger ( )
virtual
Here is the call graph for this function:

◆ Logger()

Logger::Logger ( LoggerProps props)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ _setListener()

void Logger::_setListener ( void(* cb )(const std::string &))

◆ _setLogLevel()

void Logger::_setLogLevel ( boost::log::trivial::severity_level severity)

◆ aipexceptionPre()

std::ostringstream & Logger::aipexceptionPre ( std::ostringstream & stream,
boost::log::trivial::severity_level lvl,
int type )

◆ getLogger()

Logger * Logger::getLogger ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initBoostLogger()

void Logger::initBoostLogger ( LoggerProps props)
private
Here is the caller graph for this function:

◆ initLogger()

void Logger::initLogger ( LoggerProps props)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()()

void Logger::operator() ( )
Here is the call graph for this function:

◆ pre()

std::ostringstream & Logger::pre ( std::ostringstream & stream,
boost::log::trivial::severity_level lvl )

◆ process()

bool Logger::process ( const std::string & message)
private
Here is the caller graph for this function:

◆ push()

bool Logger::push ( boost::log::trivial::severity_level level,
std::ostringstream & stream )
Here is the call graph for this function:

◆ run()

bool Logger::run ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConsoleLog()

void Logger::setConsoleLog ( bool enableLog)

◆ setFileLog()

void Logger::setFileLog ( bool enableLog)

◆ setListener()

void Logger::setListener ( void(* cb )(const std::string &))
static
Here is the call graph for this function:

◆ setLogLevel() [1/2]

void Logger::setLogLevel ( boost::log::trivial::severity_level severity)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLogLevel() [2/2]

bool Logger::setLogLevel ( const std::string & sSeverity)
static
Here is the call graph for this function:

Member Data Documentation

◆ instance

boost::shared_ptr< Logger > Logger::instance
staticprivate

◆ lg

boost::log::sources::severity_logger< boost::log::trivial::severity_level > Logger::lg
private

◆ logger_mutex

boost::mutex Logger::logger_mutex
staticprivate

◆ mConsoleSink

boost::shared_ptr< boost::log::sinks::synchronous_sink< boost::log::sinks::text_ostream_backend > > Logger::mConsoleSink
private

◆ mFileSink

boost::shared_ptr< boost::log::sinks::synchronous_sink< boost::log::sinks::text_file_backend > > Logger::mFileSink
private

◆ mListener

void(* Logger::mListener) (const std::string &) = nullptr
private

◆ mProps

LoggerProps Logger::mProps
private

◆ mQue

threadsafe_que<std::string> Logger::mQue
private

◆ mRunning

bool Logger::mRunning
private

◆ myThread

boost::thread Logger::myThread
private

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