Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
logging::RuntimeLogFileSink Class Reference

Small helper that targets one persisted runtime log file. More...

#include <src/logging/log_file.h>

Public Member Functions

bool consume (const LogEntry &entry, std::string *errorMessage=nullptr) const
 Append one log entry to the configured runtime log file.
 
const std::string & file_path () const
 Return the configured runtime log-file path.
 
bool reset (std::string *errorMessage=nullptr) const
 Truncate or recreate the configured runtime log file.
 
 RuntimeLogFileSink (std::string filePath=default_log_file_path())
 Construct a runtime log-file sink for the requested file path.
 

Detailed Description

Small helper that targets one persisted runtime log file.

Constructor & Destructor Documentation

◆ RuntimeLogFileSink()

logging::RuntimeLogFileSink::RuntimeLogFileSink ( std::string filePath = default_log_file_path())
explicit

Construct a runtime log-file sink for the requested file path.

Parameters
filePathTarget log file path.

Member Function Documentation

◆ consume()

bool logging::RuntimeLogFileSink::consume ( const LogEntry & entry,
std::string * errorMessage = nullptr ) const

Append one log entry to the configured runtime log file.

Parameters
entryStructured log entry to write.
errorMessageOptional output for file-append failures.
Returns
true when the entry was written successfully.

◆ file_path()

const std::string & logging::RuntimeLogFileSink::file_path ( ) const

Return the configured runtime log-file path.

Returns
Target log file path.

◆ reset()

bool logging::RuntimeLogFileSink::reset ( std::string * errorMessage = nullptr) const

Truncate or recreate the configured runtime log file.

Parameters
errorMessageOptional output for I/O failures.
Returns
true when the file was reset successfully.

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