Asylo
Public Member Functions | Protected Member Functions | Protected Attributes | 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]
Collaboration diagram for asylo::LogMessage:
Collaboration 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...
 

Protected Member Functions

void SendToLog (const std::string &message_text)
 

Protected Attributes

LogSeverity severity_
 
std::ostringstream stream_
 

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

◆ SendToLog()

void asylo::LogMessage::SendToLog ( const std::string &  message_text)
protected

◆ stream()

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

Gets a reference to the underlying string stream.

Returns
A reference to the underlying string stream.

Member Data Documentation

◆ severity_

LogSeverity asylo::LogMessage::severity_
protected

◆ stream_

std::ostringstream asylo::LogMessage::stream_
protected

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