LeviLamina
Loading...
Searching...
No Matches
ll::io::FileSink Class Reference

#include <FileSink.h>

Inheritance diagram for ll::io::FileSink:

Public Member Functions

LLAPI FileSink (std::filesystem::path const &path, Polymorphic< Formatter > formatter, RotatePolicy policy=RotatePolicy::disabled())
LLAPI void setFormatter (Polymorphic< Formatter > fmter) override
LLAPI void append (LogMessageView const &view) override
LLAPI void flush () override
LLAPI void setFlushLevel (LogLevel level) override
LLAPI void setPolicy (RotatePolicy policy)
LLAPI void rotate ()

Protected Attributes

Polymorphic< Formatter > formatter

Detailed Description

A sink that writes to a file, optionally rotating it by size and by date.

Note
Rotation is off by default, so the file is only appended to. Pass a RotatePolicy to have it archived; RotatePolicy{}'s own defaults are a sensible starting point.

Member Function Documentation

◆ setFormatter()

LLAPI void ll::io::FileSink::setFormatter ( Polymorphic< Formatter > fmter)
overridevirtual

Implements ll::io::SinkBase.

◆ append()

LLAPI void ll::io::FileSink::append ( LogMessageView const & view)
overridevirtual

Implements ll::io::SinkBase.

◆ flush()

LLAPI void ll::io::FileSink::flush ( )
overridevirtual

Reimplemented from ll::io::SinkBase.

◆ setFlushLevel()

LLAPI void ll::io::FileSink::setFlushLevel ( LogLevel level)
overridevirtual

Reimplemented from ll::io::SinkBase.

◆ setPolicy()

LLAPI void ll::io::FileSink::setPolicy ( RotatePolicy policy)

Replaces the rotation policy.

Note
Honours rotateOnOpen if the file still holds content inherited from a previous run, so a policy supplied shortly after construction behaves as if it had been passed to it.

◆ rotate()

LLAPI void ll::io::FileSink::rotate ( )

Rotates now, regardless of what the policy would decide. Does nothing when the active file is empty.


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