KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
Log::LogEntry Class Reference

Immutable record of a single log event. More...

#include <logentry.h>

Public Member Functions

 LogEntry ()
 Default constructor — creates an empty Debug-level entry.
 
 LogEntry (LogLevel level, const LogCategory &category, const QDateTime &timestamp, const QString &formattedText, const QString &unformattedText)
 Construct a LogEntry with all fields.
 
LogLevel level () const
 Return the severity level.
 
Log::LogCategory category () const
 Return the log category.
 
QDateTime timestamp () const
 Return the timestamp when this entry was created.
 
QString formattedText () const
 Return the pre-formatted message text.
 
QString unformattedText () const
 Return the raw, unformatted message text.
 

Detailed Description

Immutable record of a single log event.

LogEntry objects are created by Logger and delivered to LogConsumer instances. They capture the severity level, category, timestamp, and both the raw and pre-formatted message text.

Definition at line 20 of file logentry.h.

Constructor & Destructor Documentation

◆ LogEntry() [1/2]

Log::LogEntry::LogEntry ( )
inline

Default constructor — creates an empty Debug-level entry.

Definition at line 24 of file logentry.h.

◆ LogEntry() [2/2]

Log::LogEntry::LogEntry ( LogLevel  level,
const LogCategory category,
const QDateTime &  timestamp,
const QString &  formattedText,
const QString &  unformattedText 
)
inline

Construct a LogEntry with all fields.

Parameters
levelSeverity level of this entry
categoryLog category associated with this entry
timestampWhen this entry was generated
formattedTextPre-formatted message text (includes level, timestamp, etc.)
unformattedTextRaw message text without formatting

Definition at line 34 of file logentry.h.

References Log::level().

Member Function Documentation

◆ category()

Log::LogCategory Log::LogEntry::category ( ) const
inline

Return the log category.

Returns
LogCategory associated with this entry

Definition at line 47 of file logentry.h.

◆ formattedText()

QString Log::LogEntry::formattedText ( ) const
inline

Return the pre-formatted message text.

Returns
Message string including level, timestamp, and line number decorations

Definition at line 59 of file logentry.h.

◆ level()

LogLevel Log::LogEntry::level ( ) const
inline

Return the severity level.

Returns
LogLevel of this entry

Definition at line 41 of file logentry.h.

◆ timestamp()

QDateTime Log::LogEntry::timestamp ( ) const
inline

Return the timestamp when this entry was created.

Returns
QDateTime of the log event

Definition at line 53 of file logentry.h.

◆ unformattedText()

QString Log::LogEntry::unformattedText ( ) const
inline

Return the raw, unformatted message text.

Returns
Plain message string without any logging decorations

Definition at line 65 of file logentry.h.


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