arcstk::v_1_0_0::Appender class final
#include <logging.hpp>

A named logging output channel.

An Appender can be constructed for either a std::string representing a filename or a FILE* along with a name.

An Appender always has a name. If the Appender is constructed with just a filename, this filename becomes its name. If it is constructed with a FILE* and a name, the name is arbitrary.

Constructors, destructors, conversion operators

Appender(Appender&& rhs) noexcept
Move constructor.
Appender(const Appender&) deleted
Appender is non-copyable.
Appender(const std::string& filename) explicit
Constructs an Appender for appending to the given file.
Appender(const std::string& name, FILE* stream)
Constructs an Appender for appending to the given FILE.
~Appender() noexcept
Destructor.

Public functions

void append(const std::string& msg) const
Append the specified message.
auto name() const -> std::string noexcept
Name of the Appender.

Function documentation

arcstk::v_1_0_0::Appender::Appender(Appender&& rhs) noexcept

Move constructor.

Parameters
rhs in The instance to move

arcstk::v_1_0_0::Appender::Appender(const std::string& filename) explicit

Constructs an Appender for appending to the given file.

Parameters
filename in File to append to and name of the Appender

The filename becomes the name of the Appender.

arcstk::v_1_0_0::Appender::Appender(const std::string& name, FILE* stream)

Constructs an Appender for appending to the given FILE.

Parameters
name in Name of the Appender
stream in The FILE to append to

The stream may also be stdout, stderr etc.

void arcstk::v_1_0_0::Appender::append(const std::string& msg) const

Append the specified message.

Parameters
msg in The message to append

std::string arcstk::v_1_0_0::Appender::name() const noexcept

Name of the Appender.

Returns Name of the Appender