OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::LogSink Class Reference

#include <LogSink.hpp>

+ Inheritance diagram for openstudio::LogSink:

Public Member Functions

bool autoFlush () const
 get if messages are automatically flushed
 
boost::optional< boost::regex > channelRegex () const
 get the regular expression to match log channels
 
void disable ()
 disable the sink
 
void enable ()
 enable the sink
 
bool isEnabled () const
 is the sink enabled
 
boost::optional< LogLevel > logLevel () const
 get the logging level
 
void resetChannelRegex ()
 reset the regular expression to match log channels
 
void resetLogLevel ()
 reset the core logging level
 
void resetThreadId ()
 reset the thread id that messages are filtered by
 
void setAutoFlush (bool autoFlush)
 set if messages are automatically flushed
 
void setChannelRegex (const boost::regex &channelRegex)
 set the regular expression to match log channels
 
void setChannelRegex (const std::string &channelRegex)
 set the regular expression to match log channels
 
void setFormatter (const boost::log::formatter &fmter)
 
void setLogLevel (LogLevel logLevel)
 set the logging level
 
void setThreadId (std::thread::id threadId)
 set the thread id that messages are filtered by
 
std::thread::id threadId () const
 get the thread id that messages are filtered by
 
void useWorkflowGemFormatter (bool use, bool include_channel=true)
 

Protected Member Functions

 LogSink ()
 
 LogSink (const boost::shared_ptr< detail::LogSink_Impl > &impl)
 
void setStream (boost::shared_ptr< std::ostream > os)
 
boost::shared_ptr< LogSinkBackendsink () const
 

Detailed Description

LogSink is a class for managing sinks for log messages, e.g. files, streams, etc.

Constructor & Destructor Documentation

◆ LogSink() [1/2]

openstudio::LogSink::LogSink ( )
protected

◆ LogSink() [2/2]

openstudio::LogSink::LogSink ( const boost::shared_ptr< detail::LogSink_Impl > & impl)
protected

Member Function Documentation

◆ autoFlush()

bool openstudio::LogSink::autoFlush ( ) const

get if messages are automatically flushed

◆ channelRegex()

boost::optional< boost::regex > openstudio::LogSink::channelRegex ( ) const

get the regular expression to match log channels

◆ disable()

void openstudio::LogSink::disable ( )

disable the sink

◆ enable()

void openstudio::LogSink::enable ( )

enable the sink

◆ isEnabled()

bool openstudio::LogSink::isEnabled ( ) const

is the sink enabled

◆ logLevel()

boost::optional< LogLevel > openstudio::LogSink::logLevel ( ) const

get the logging level

◆ resetChannelRegex()

void openstudio::LogSink::resetChannelRegex ( )

reset the regular expression to match log channels

◆ resetLogLevel()

void openstudio::LogSink::resetLogLevel ( )

reset the core logging level

◆ resetThreadId()

void openstudio::LogSink::resetThreadId ( )

reset the thread id that messages are filtered by

◆ setAutoFlush()

void openstudio::LogSink::setAutoFlush ( bool autoFlush)

set if messages are automatically flushed

◆ setChannelRegex() [1/2]

void openstudio::LogSink::setChannelRegex ( const boost::regex & channelRegex)

set the regular expression to match log channels

◆ setChannelRegex() [2/2]

void openstudio::LogSink::setChannelRegex ( const std::string & channelRegex)

set the regular expression to match log channels

◆ setFormatter()

void openstudio::LogSink::setFormatter ( const boost::log::formatter & fmter)

◆ setLogLevel()

void openstudio::LogSink::setLogLevel ( LogLevel logLevel)

set the logging level

◆ setStream()

void openstudio::LogSink::setStream ( boost::shared_ptr< std::ostream > os)
protected

◆ setThreadId()

void openstudio::LogSink::setThreadId ( std::thread::id threadId)

set the thread id that messages are filtered by

◆ sink()

boost::shared_ptr< LogSinkBackend > openstudio::LogSink::sink ( ) const
protected

◆ threadId()

std::thread::id openstudio::LogSink::threadId ( ) const

get the thread id that messages are filtered by

◆ useWorkflowGemFormatter()

void openstudio::LogSink::useWorkflowGemFormatter ( bool use,
bool include_channel = true )