SPH
Public Member Functions | List of all members
StringLogger Class Reference

Logger writing messages to string stream. More...

#include <Logger.h>

Inheritance diagram for StringLogger:
ILogger Polymorphic Noncopyable

Public Member Functions

virtual void writeString (const std::string &s) override
 Logs a string message. More...
 
void clean ()
 Removes all written messages from the string. More...
 
std::string toString () const
 Returns all written messages as a string. Messages are not erased from the logger by this. More...
 
- Public Member Functions inherited from ILogger
template<typename... TArgs>
void write (TArgs &&... args)
 Creates and logs a message by concatenating arguments. More...
 
void setPrecision (const Size newPrecision)
 Changes the precision of printed numbers. More...
 
void setScientific (const bool newScientific)
 Sets/unsets scientific notation. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

Logger writing messages to string stream.

Definition at line 145 of file Logger.h.

Member Function Documentation

◆ clean()

void StringLogger::clean ( )

Removes all written messages from the string.

Definition at line 28 of file Logger.cpp.

◆ toString()

std::string StringLogger::toString ( ) const

Returns all written messages as a string. Messages are not erased from the logger by this.

Definition at line 35 of file Logger.cpp.

◆ writeString()

void StringLogger::writeString ( const std::string &  s)
overridevirtual

Logs a string message.

Todo:
different types (log, warning, error, ...) and levels of verbosity

Implements ILogger.

Definition at line 24 of file Logger.cpp.


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