EasyException
ee::LogEntry Class Reference

Holds all information regarding a single LogEntry. More...

#include <ee/LogEntry.hpp>

Public Member Functions

 LogEntry (LogLevel logLevel, const std::string &classname, const std::string &method, const std::string &message, const std::vector< Note > &notes, const std::optional< std::shared_ptr< Stacktrace >> &stacktrace, const std::chrono::system_clock::time_point &dateOfCreation) noexcept
 Constructor. More...
 
LogLevel getLogLevel () const noexcept
 Returns the LogLevel of this LogEntry. More...
 
const std::string & getClassname () const noexcept
 Returns the classname of the caller. More...
 
const std::string & getMethod () const noexcept
 Returns the method name of the caller. More...
 
const std::string & getMessage () const noexcept
 Returns a message describing the incident. More...
 
const std::vector< Note > & getNotes () const noexcept
 Returns a list of notes normally containing variables and other useful informtion. More...
 
const std::optional< std::shared_ptr< Stacktrace > > & getStacktrace () const noexcept
 Returns an optional that can contain a stacktrace. More...
 
const std::chrono::system_clock::time_point & getDateOfCreation () const noexcept
 Returns the date of occurrence. More...
 
void write (std::ostream &stream) const noexcept
 Writes the LogEntry to an outstream . More...
 

Private Attributes

LogLevel mLogLevel
 Holds the LogLevel.
 
std::string mClassname
 Holds the classname of the caller.
 
std::string mMethod
 Holds the method name of the caller.
 
std::string mMessage
 Holds the message describing the incident.
 
std::vector< NotemNotes
 Holds a list of notes containing useful information.
 
std::optional< std::shared_ptr< Stacktrace > > mStacktrace
 Holds an optional that can hold a stacktrace.
 
std::chrono::system_clock::time_point mDateOfCreation
 Holds the date of occurrence.
 

Detailed Description

Holds all information regarding a single LogEntry.

Constructor & Destructor Documentation

ee::LogEntry::LogEntry ( LogLevel  logLevel,
const std::string &  classname,
const std::string &  method,
const std::string &  message,
const std::vector< Note > &  notes,
const std::optional< std::shared_ptr< Stacktrace >> &  stacktrace,
const std::chrono::system_clock::time_point &  dateOfCreation 
)
noexcept

Constructor.

Parameters
logLevelThe LogLevel of the LogEntry.
classnameThe classname of the caller.
methodThe methodname of the caller.
messageThe message describing the incident.
notesA list of notes containing variables and other usful information.
stacktraceCan hold a stacktrace.
dateOfCreationThe date of occurrence.

Member Function Documentation

const std::string& ee::LogEntry::getClassname ( ) const
noexcept

Returns the classname of the caller.

Returns
Classname of the caller.
const std::chrono::system_clock::time_point& ee::LogEntry::getDateOfCreation ( ) const
noexcept

Returns the date of occurrence.

Returns
Date of occurrence.
LogLevel ee::LogEntry::getLogLevel ( ) const
noexcept

Returns the LogLevel of this LogEntry.

Returns
The LogLevel of this LogEntry.
const std::string& ee::LogEntry::getMessage ( ) const
noexcept

Returns a message describing the incident.

Returns
Message describing the incident.
const std::string& ee::LogEntry::getMethod ( ) const
noexcept

Returns the method name of the caller.

Returns
Method name of the caller.
const std::vector<Note>& ee::LogEntry::getNotes ( ) const
noexcept

Returns a list of notes normally containing variables and other useful informtion.

Returns
List of notes.
const std::optional<std::shared_ptr<Stacktrace> >& ee::LogEntry::getStacktrace ( ) const
noexcept

Returns an optional that can contain a stacktrace.

Returns
Optional that can contain a stacktrace.
void ee::LogEntry::write ( std::ostream &  stream) const
noexcept

Writes the LogEntry to an outstream .

Parameters
streamThe stream to write to.

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