carl  24.04
Computer ARithmetic Library
carl::logging::FileSink Class Reference

Logging sink for file output. More...

#include <Sink.h>

Inheritance diagram for carl::logging::FileSink:
Collaboration diagram for carl::logging::FileSink:

Public Member Functions

virtual ~FileSink ()=default
 
 FileSink (const std::string &filename)
 Create a FileSink that logs to the specified file. More...
 
std::ostream & log () noexcept override
 Abstract logging interface. More...
 

Private Attributes

std::ofstream os
 File output stream. More...
 

Detailed Description

Logging sink for file output.

Definition at line 38 of file Sink.h.

Constructor & Destructor Documentation

◆ ~FileSink()

virtual carl::logging::FileSink::~FileSink ( )
virtualdefault

◆ FileSink()

carl::logging::FileSink::FileSink ( const std::string &  filename)
inlineexplicit

Create a FileSink that logs to the specified file.

The file is truncated upon construction.

Parameters
filename

Definition at line 48 of file Sink.h.

Member Function Documentation

◆ log()

std::ostream& carl::logging::FileSink::log ( )
inlineoverridevirtualnoexcept

Abstract logging interface.

The intended usage is to write any log output to the output stream returned by this function.

Returns
Output stream.

Implements carl::logging::Sink.

Definition at line 49 of file Sink.h.

Field Documentation

◆ os

std::ofstream carl::logging::FileSink::os
private

File output stream.

Definition at line 40 of file Sink.h.


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