29 #ifndef Pt_System_LogRecord_h
30 #define Pt_System_LogRecord_h
32 #include <Pt/System/Api.h>
33 #include <Pt/System/LogLevel.h>
34 #include <Pt/SourceInfo.h>
35 #include <Pt/NonCopyable.h>
96 , _source(
"unknown",
"unknown",
"unknown")
106 _text.str( std::string() );
112 {
return _text.str(); }
123 template <
typename T>
159 std::ostringstream _text;
168 #endif // Pt_System_LogRecord_h
LogRecord & operator<<(const Pt::SourceInfo &si)
Sets the source location of the log record.
Definition: LogRecord.h:152
Log records can be added to a log.
Definition: LogRecord.h:90
Protects derived classes from being copied.
Definition: NonCopyable.h:54
LogLevel
Severity of the log-message.
Definition: LogLevel.h:41
LogLevel logLevel() const
Returns the severity level.
Definition: LogRecord.h:115
~LogRecord()
@ Destructor.
Definition: LogRecord.h:100
LogRecord & operator<<(std::ios &(*op)(std::ios &))
Applies op to the log record's text.
Definition: LogRecord.h:138
const Pt::SourceInfo & sourceInfo() const
Returns the location in the source where the record was generated.
Definition: LogRecord.h:119
LogRecord & operator<<(std::ostream &(*op)(std::ostream &))
Applies op to the log record's text.
Definition: LogRecord.h:131
void clear()
Clears all content of the record.
Definition: LogRecord.h:104
Source code info class.
Definition: SourceInfo.h:100
LogRecord & operator<<(const T &value)
Appends value to the log record's text.
Definition: LogRecord.h:124
LogRecord(const LogLevel &level)
Construct a log record with a severity level.
Definition: LogRecord.h:94
LogRecord & operator<<(std::ios_base &(*op)(std::ios_base &))
Applies op to the log record's text.
Definition: LogRecord.h:145
std::string text() const
Returns the textual of the record.
Definition: LogRecord.h:111