Asylo
Public Member Functions | List of all members
asylo::LogMessage Class Reference

Class representing a log message created by a log macro. More...

#include <logging.h>

Inheritance diagram for asylo::LogMessage:
Inheritance graph
[legend]

Public Member Functions

 LogMessage (const char *file, int line)
 Constructs a new message with INFO severity. More...
 
 LogMessage (const char *file, int line, LogSeverity severity)
 Constructs a new message with the specified severity. More...
 
 LogMessage (const char *file, int line, const std::string &result)
 Constructs a log message with additional text that is provided by CHECK macros. More...
 
 ~LogMessage ()
 The destructor flushes the message. More...
 
std::ostringstream & stream ()
 Gets a reference to the underlying string stream. More...
 

Detailed Description

Class representing a log message created by a log macro.

Constructor & Destructor Documentation

◆ LogMessage() [1/3]

asylo::LogMessage::LogMessage ( const char *  file,
int  line 
)

Constructs a new message with INFO severity.

Parameters
fileThe source file that produced the log.
lineThe source code line that produced the log.

◆ LogMessage() [2/3]

asylo::LogMessage::LogMessage ( const char *  file,
int  line,
LogSeverity  severity 
)

Constructs a new message with the specified severity.

Parameters
fileThe source file that produced the log.
lineThe source code line that produced the log.
severityThe severity level of the log.

◆ LogMessage() [3/3]

asylo::LogMessage::LogMessage ( const char *  file,
int  line,
const std::string &  result 
)

Constructs a log message with additional text that is provided by CHECK macros.

Parameters
fileThe source file that produced the log.
lineThe source code line that produced the log.
resultThe result message when check fails.

◆ ~LogMessage()

asylo::LogMessage::~LogMessage ( )

The destructor flushes the message.

Member Function Documentation

◆ stream()

std::ostringstream& asylo::LogMessage::stream ( )
inline

Gets a reference to the underlying string stream.

Returns
A reference to the underlying string stream.

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