RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | Protected Attributes | List of all members
rstudio::launcher_plugins::logging::ILogDestination Class Referenceabstract

Interface which allows a logger to write a log message to a destination. More...

#include <ILogDestination.hpp>

Inheritance diagram for rstudio::launcher_plugins::logging::ILogDestination:
rstudio::launcher_plugins::Noncopyable rstudio::launcher_plugins::logging::FileLogDestination

Public Member Functions

 ILogDestination (const std::string &in_id, LogLevel in_logLevel, LogMessageFormatType in_formatType, bool in_reloadable)
 Constructor. More...
 
virtual ~ILogDestination ()=default
 Virtual destructor to allow for inheritance.
 
std::string getId () const
 Gets the unique ID of the log destination. More...
 
LogLevel getLogLevel ()
 Gets the maximum level of logs that will be written to this log destination. More...
 
LogMessageFormatType getLogMessageFormatType ()
 Gets the log message format type for this log destination. More...
 
bool isReloadable () const
 Gets whether or not the log destination is reloadable. More...
 
virtual void refresh (const RefreshParams &in_refreshParams=RefreshParams())=0
 Refresh the log destintation. Ensures that the log does not have any stale file handles. More...
 
virtual void writeLog (LogLevel in_logLevel, const std::string &in_message)=0
 Writes a message to this log destination. More...
 

Protected Attributes

std::string m_id
 The unique ID of the log destination.
 
LogLevel m_logLevel
 The maximum level of log messages to write for this logger.
 
LogMessageFormatType m_formatType
 The log message format type.
 
bool m_reloadable
 Whether or not the log destination is reloadable (i.e. it will be destroyed when the global logger is reinitialized).
 

Detailed Description

Interface which allows a logger to write a log message to a destination.

Constructor & Destructor Documentation

◆ ILogDestination()

rstudio::launcher_plugins::logging::ILogDestination::ILogDestination ( const std::string &  in_id,
LogLevel  in_logLevel,
LogMessageFormatType  in_formatType,
bool  in_reloadable 
)
inlineexplicit

Constructor.

Parameters
in_idThe unique ID of this log destination. You must ensure that sufficient uniqueness is provided to ensure no other log destinations attempt to use the same ID, which will prevent them from being registered.
in_logLevelThe most detailed level of log to be written to this log destination.
in_formatTypeThe log message format type.
in_reloadableWhether or not the destination is reloadable. If so, reloading of logging configuration will cause the log destination to be removed. Set this to true only for log destinations that are intended to be hot-reconfigurable, such as the global default logger.

Member Function Documentation

◆ getId()

std::string rstudio::launcher_plugins::logging::ILogDestination::getId ( ) const
inline

Gets the unique ID of the log destination.

Returns
The unique ID of the log destination.

◆ getLogLevel()

LogLevel rstudio::launcher_plugins::logging::ILogDestination::getLogLevel ( )
inline

Gets the maximum level of logs that will be written to this log destination.

Returns
This log destination's maximum log level.

◆ getLogMessageFormatType()

LogMessageFormatType rstudio::launcher_plugins::logging::ILogDestination::getLogMessageFormatType ( )
inline

Gets the log message format type for this log destination.

Returns
This log destination's message format type.

◆ isReloadable()

bool rstudio::launcher_plugins::logging::ILogDestination::isReloadable ( ) const
inline

Gets whether or not the log destination is reloadable.

Returns
Whether or not the log destination is reloadable.

◆ refresh()

virtual void rstudio::launcher_plugins::logging::ILogDestination::refresh ( const RefreshParams in_refreshParams = RefreshParams())
pure virtual

Refresh the log destintation. Ensures that the log does not have any stale file handles.

Parameters
in_refreshParamsRefresh params to use when refreshing the log destinations (if applicable).

Implemented in rstudio::launcher_plugins::logging::FileLogDestination.

◆ writeLog()

virtual void rstudio::launcher_plugins::logging::ILogDestination::writeLog ( LogLevel  in_logLevel,
const std::string &  in_message 
)
pure virtual

Writes a message to this log destination.

Parameters
in_logLevelThe log level of the message to write.
in_messageThe message to write to the destination.

Implemented in rstudio::launcher_plugins::logging::FileLogDestination.


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