Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::LogOutput Class Referenceabstract

Base class for log output handling. More...

#include <Log.hpp>

Inheritance diagram for Nektar::LogOutput:
[legend]

Public Member Functions

 LogOutput ()=default
 Default constructor.
 
virtual ~LogOutput ()=default
 
virtual void Log (const std::string &msg)=0
 Write a log message.
 
bool IsTty () const
 Returns true if this is an interactive (tty) terminal (e.g. stdout).
 

Protected Member Functions

virtual void Finalise ()=0
 Finalise the log.
 

Protected Attributes

bool m_isTty = true
 True if this log output is tty-based.
 

Detailed Description

Base class for log output handling.

This class defines the abstract concept of log writing, where subclasses implement concrete implementations for e.g. writing to stdout or a file.

Definition at line 78 of file Log.hpp.

Constructor & Destructor Documentation

◆ LogOutput()

Nektar::LogOutput::LogOutput ( )
default

Default constructor.

◆ ~LogOutput()

virtual Nektar::LogOutput::~LogOutput ( )
virtualdefault

Member Function Documentation

◆ Finalise()

virtual void Nektar::LogOutput::Finalise ( )
protectedpure virtual

Finalise the log.

When called, this function should any finalising required for the log (e.g. closing a file).

Implemented in Nektar::StreamOutput.

◆ IsTty()

bool Nektar::LogOutput::IsTty ( ) const
inline

Returns true if this is an interactive (tty) terminal (e.g. stdout).

Definition at line 99 of file Log.hpp.

100 {
101 return m_isTty;
102 }
bool m_isTty
True if this log output is tty-based.
Definition Log.hpp:106

References m_isTty.

◆ Log()

virtual void Nektar::LogOutput::Log ( const std::string &  msg)
pure virtual

Write a log message.

Subclasses should override this function to write out the log message defined in msg.

Parameters
msgLog message to write.

Implemented in Nektar::StreamOutput.

Member Data Documentation

◆ m_isTty

bool Nektar::LogOutput::m_isTty = true
protected

True if this log output is tty-based.

Definition at line 106 of file Log.hpp.

Referenced by IsTty(), and Nektar::StreamOutput::StreamOutput().