RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
Class which allows sending log messages to a file. More...
#include <FileLogDestination.hpp>
Public Member Functions | |
FileLogDestination (const std::string &in_id, LogLevel in_logLevel, LogMessageFormatType in_formatType, const std::string &in_programId, FileLogOptions in_logOptions, bool in_reloadable=false) | |
Constructor. More... | |
~FileLogDestination () override | |
Destructor. | |
std::string | path () |
Returns the log destination. | |
void | refresh (const RefreshParams &in_refreshParams=RefreshParams()) override |
Refreshes the log destintation. Ensures that the log does not have any stale file handles. More... | |
void | writeLog (LogLevel in_logLevel, const std::string &in_message) override |
Writes a message to the log file. More... | |
Public Member Functions inherited from rstudio::launcher_plugins::logging::ILogDestination | |
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... | |
Additional Inherited Members | |
Protected Attributes inherited from rstudio::launcher_plugins::logging::ILogDestination | |
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). | |
Class which allows sending log messages to a file.
rstudio::launcher_plugins::logging::FileLogDestination::FileLogDestination | ( | const std::string & | in_id, |
LogLevel | in_logLevel, | ||
LogMessageFormatType | in_formatType, | ||
const std::string & | in_programId, | ||
FileLogOptions | in_logOptions, | ||
bool | in_reloadable = false |
||
) |
Constructor.
in_id | The ID of this log destination. Must be unique for each log destination. |
in_logLevel | The most detailed level of log to be written to this log file. |
in_formatType | The format type for log messages. |
in_programId | The ID of this program. |
in_logOptions | The options for log file creation and management. |
in_reloadable | Whether 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. |
If the log file cannot be opened, no logs will be written to the file. If there are other log destinations registered an error will be logged regarding the failure.
|
overridevirtual |
Refreshes the log destintation. Ensures that the log does not have any stale file handles.
in_refreshParams | Refresh params to use when refreshing the log destinations (if applicable). |
Implements rstudio::launcher_plugins::logging::ILogDestination.
|
overridevirtual |
Writes a message to the log file.
in_logLevel | The log level of the message to write. Filtering is done prior to this call. This is for informational purposes only. |
in_message | The message to write to the log file. |
Implements rstudio::launcher_plugins::logging::ILogDestination.