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

Class which represents the options for a file logger. More...

#include <FileLogDestination.hpp>

Public Member Functions

 FileLogOptions (system::FilePath in_directory)
 Constructor. More...
 
 FileLogOptions (system::FilePath in_directory, bool in_warnSyslog)
 Constructor. More...
 
 FileLogOptions (system::FilePath in_directory, std::string in_fileMode, double in_maxSizeMb, int in_rotationDays, int in_maxRotations, int in_deletionDays, bool in_doRotation, bool in_includePid, bool in_warnSyslog, bool in_forceLogDirectory)
 Constructor. More...
 
int getDeletionDays () const
 Gets the number of days a rotated log file should persist before being deleted. More...
 
const system::FilePathgetDirectory () const
 Gets the directory where log files should be written. More...
 
const std::string & getFileMode () const
 Gets the permissions with which log files should be created. More...
 
bool getForceDirectory () const
 Gets whether or not the log directory is forced, preventing user override. More...
 
int getMaxRotations () const
 Gets the maximum number of allowed rotated log files. More...
 
double getMaxSizeMb () const
 Gets the maximum size of log files, in MB. More...
 
int getRotationDays () const
 Gets the number of days a log file should persist before being rotated. More...
 
bool doRotation () const
 Returns whether or not to rotate log files before overwriting them. More...
 
bool includePid () const
 Returns whether or not to include the PID in the log filename. More...
 
bool warnSyslog () const
 Returns whether or not to also send warn/error logs to syslog for admin visibility. More...
 
void setDeletionDays (int in_deletionDays)
 Sets the number of days a rotated log file should persist before being deleted. More...
 
void setDirectory (const system::FilePath &in_directory)
 Sets the directory where log files should be written. More...
 
void setFileMode (const std::string &in_fileMode)
 Sets the permissions with which the log files should be created. More...
 
void setForceDirectory (bool in_forceDirectory)
 Sets whether or not the log directory is forced, preventing user override. More...
 
void setMaxRotations (int in_maxRotations)
 Sets the maximum number of allowed rotated log files. More...
 
void setMaxSizeMb (double in_maxSizeMb)
 Sets the maximum size of the log files, in MB. More...
 
void setRotationDays (int in_rotationDays)
 Sets the number of days a log file should persist before being rotated. More...
 
void setDoRotation (bool in_doRotation)
 Sets whether or not to rotate log files before overwriting them. More...
 
void setIncludePid (bool in_includePid)
 Sets whether or not to include the PID of the process in the log filename. More...
 
void setWarnSyslog (bool in_warnSyslog)
 Sets whether or not to also send warn/error logs to syslog for admin visibility. More...
 

Detailed Description

Class which represents the options for a file logger.

Constructor & Destructor Documentation

◆ FileLogOptions() [1/3]

rstudio::launcher_plugins::logging::FileLogOptions::FileLogOptions ( system::FilePath  in_directory)

Constructor.

This constructor is intentionally not explicit to allow for conversion from system::FilePath to FileLogOptions.

Parameters
in_directoryThe directory in which to create log files.

◆ FileLogOptions() [2/3]

rstudio::launcher_plugins::logging::FileLogOptions::FileLogOptions ( system::FilePath  in_directory,
bool  in_warnSyslog 
)

Constructor.

This constructor is intentionally not explicit to allow for conversion from system::FilePath to FileLogOptions.

Parameters
in_directoryThe directory in which to create log files.
in_warnSyslogWhether or not to also send warn/error logs to syslog for admin visibility.

◆ FileLogOptions() [3/3]

rstudio::launcher_plugins::logging::FileLogOptions::FileLogOptions ( system::FilePath  in_directory,
std::string  in_fileMode,
double  in_maxSizeMb,
int  in_rotationDays,
int  in_maxRotations,
int  in_deletionDays,
bool  in_doRotation,
bool  in_includePid,
bool  in_warnSyslog,
bool  in_forceLogDirectory 
)

Constructor.

Parameters
in_directoryThe directory in which to create log files.
in_fileModeThe permissions to set on log files.
in_maxSizeMbThe maximum size of log files, in MB, before they are rotated and/or overwritten.
in_rotationDaysThe number of days a log file should be kept before being rotated.
in_maxRotationsThe maximum number of allowed rotated log files.
in_deleteDaysThe number of days a rotated log file should be kept before being deleted.
in_doRotationWhether to rotate log files or not.
in_includePidWhether to include the PID of the process in the log filename.
in_warnSyslogWhether or not to also send warn/error logs to syslog for admin visibility.
in_forceLogDirectoryWhether or not the log directory is forced, preventing user override.

Member Function Documentation

◆ doRotation()

bool rstudio::launcher_plugins::logging::FileLogOptions::doRotation ( ) const

Returns whether or not to rotate log files before overwriting them.

Returns
True if log files should be rotated; false otherwise.

◆ getDeletionDays()

int rstudio::launcher_plugins::logging::FileLogOptions::getDeletionDays ( ) const

Gets the number of days a rotated log file should persist before being deleted.

Returns
The number of days a rotated log file should persist before being deleted.

◆ getDirectory()

const system::FilePath& rstudio::launcher_plugins::logging::FileLogOptions::getDirectory ( ) const

Gets the directory where log files should be written.

Returns
The directory where log files should be written.

◆ getFileMode()

const std::string& rstudio::launcher_plugins::logging::FileLogOptions::getFileMode ( ) const

Gets the permissions with which log files should be created.

Returns
The permissions with which log files should be created.

◆ getForceDirectory()

bool rstudio::launcher_plugins::logging::FileLogOptions::getForceDirectory ( ) const

Gets whether or not the log directory is forced, preventing user override.

Returns
Whether or not the log directory is forced, preventing user override.

◆ getMaxRotations()

int rstudio::launcher_plugins::logging::FileLogOptions::getMaxRotations ( ) const

Gets the maximum number of allowed rotated log files.

Returns
The maximum number of allowed rotated log files.

◆ getMaxSizeMb()

double rstudio::launcher_plugins::logging::FileLogOptions::getMaxSizeMb ( ) const

Gets the maximum size of log files, in MB.

Returns
The maximum size of log files, in MB.

◆ getRotationDays()

int rstudio::launcher_plugins::logging::FileLogOptions::getRotationDays ( ) const

Gets the number of days a log file should persist before being rotated.

Returns
The number of days a log file should persist before being rotated.

◆ includePid()

bool rstudio::launcher_plugins::logging::FileLogOptions::includePid ( ) const

Returns whether or not to include the PID in the log filename.

Returns
True if the PID should be included in the log filename; false otherwise.

◆ setDeletionDays()

void rstudio::launcher_plugins::logging::FileLogOptions::setDeletionDays ( int  in_deletionDays)

Sets the number of days a rotated log file should persist before being deleted.

Parameters
in_deletionDaysThe number of days a rotated log file should be kept before being deleted.

◆ setDirectory()

void rstudio::launcher_plugins::logging::FileLogOptions::setDirectory ( const system::FilePath in_directory)

Sets the directory where log files should be written.

  • Parameters
    in_directoryThe directory in which to create log files.

◆ setDoRotation()

void rstudio::launcher_plugins::logging::FileLogOptions::setDoRotation ( bool  in_doRotation)

Sets whether or not to rotate log files before overwriting them.

Parameters
in_doRotationWhether to rotate log files or not.

◆ setFileMode()

void rstudio::launcher_plugins::logging::FileLogOptions::setFileMode ( const std::string &  in_fileMode)

Sets the permissions with which the log files should be created.

Parameters
in_fileModeThe permissions to set on log files.

◆ setForceDirectory()

void rstudio::launcher_plugins::logging::FileLogOptions::setForceDirectory ( bool  in_forceDirectory)

Sets whether or not the log directory is forced, preventing user override.

Parameters
in_forceDirectoryWhether or not the log directory is forced, preventing user override.

◆ setIncludePid()

void rstudio::launcher_plugins::logging::FileLogOptions::setIncludePid ( bool  in_includePid)

Sets whether or not to include the PID of the process in the log filename.

Parameters
in_includePidWhether to include the PID of the process in the log file name.

◆ setMaxRotations()

void rstudio::launcher_plugins::logging::FileLogOptions::setMaxRotations ( int  in_maxRotations)

Sets the maximum number of allowed rotated log files.

Parameters
in_maxRotationsThe maximum number of allowed rotated log files.

◆ setMaxSizeMb()

void rstudio::launcher_plugins::logging::FileLogOptions::setMaxSizeMb ( double  in_maxSizeMb)

Sets the maximum size of the log files, in MB.

Parameters
in_maxSizeMbThe maximum size of log files, in MB, before they are rotated and/or overwritten.

◆ setRotationDays()

void rstudio::launcher_plugins::logging::FileLogOptions::setRotationDays ( int  in_rotationDays)

Sets the number of days a log file should persist before being rotated.

Parameters
in_rotationDaysThe number of days a log file should be kept before being rotated.

◆ setWarnSyslog()

void rstudio::launcher_plugins::logging::FileLogOptions::setWarnSyslog ( bool  in_warnSyslog)

Sets whether or not to also send warn/error logs to syslog for admin visibility.

Parameters
in_warnSyslogWhether or not to also send warn/error logs to syslog for admin visibility.

◆ warnSyslog()

bool rstudio::launcher_plugins::logging::FileLogOptions::warnSyslog ( ) const

Returns whether or not to also send warn/error logs to syslog for admin visibility.

Returns
True if warn/error logs should be duplicated to syslog; false otherwise.

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