ReXGlue SDK
Loading...
Searching...
No Matches
rex::log::LogFileSink Class Referencefinal

#include <rex/logging/logger.h>

Inheritance diagram for rex::log::LogFileSink:
[legend]

Public Member Functions

void Write (const Message &message) override
void Flush () override
const std::filesystem::path & GetPath () const
 LogFileSink (std::filesystem::path path, std::ofstream file, LineFormat format)

Static Public Member Functions

static Result< std::unique_ptr< LogFileSink > > Open (const std::filesystem::path &path, LineFormat format)

Additional Inherited Members

Protected Member Functions inherited from rex::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete

Detailed Description

A log file with a level letter column (T, V, D, I, W, E, C) after the timestamp.

Constructor & Destructor Documentation

◆ LogFileSink()

rex::log::LogFileSink::LogFileSink ( std::filesystem::path path,
std::ofstream file,
LineFormat format )

Wraps an open stream. Open is the usual way to build the sink.

Parameters
formatWhat to write around each message. color is ignored.

Member Function Documentation

◆ Flush()

void rex::log::LogFileSink::Flush ( )
overridevirtual

Implements rex::log::ILogSink.

◆ GetPath()

const std::filesystem::path & rex::log::LogFileSink::GetPath ( ) const
Returns
The path passed to Open.

◆ Open()

Result< std::unique_ptr< LogFileSink > > rex::log::LogFileSink::Open ( const std::filesystem::path & path,
LineFormat format )
staticnodiscard

Opens a file for appending.

Parameters
pathThe file. Missing parent folders are created.
formatWhat to write around each message. color is ignored.
Returns
The sink, or an error naming the path.

◆ Write()

void rex::log::LogFileSink::Write ( const Message & message)
overridevirtual

Implements rex::log::ILogSink.


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