HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Related Functions
rwsf::LogMessage Class Reference

Constructs log messages, provides insertion operators for basic types, and can be extended to support user-defined types as well. More...

#include <rwsf/core/LogMessage.h>

Public Member Functions

 LogMessage ()
 
void append (const std::string &str)
 
virtual std::string str () const
 

Related Functions

(Note that these are not member functions.)

rwsf::LogMessageoperator<< (rwsf::LogMessage &, bool)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, char)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, unsigned char)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, short)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, unsigned short)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, int)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, unsigned int)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, long)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, unsigned long)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, float)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, double)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, const char *)
 
rwsf::LogMessageoperator<< (rwsf::LogMessage &, const std::string &)
 

Detailed Description

rwsf::LogMessage is a utility class for constructing log messages. LogMessage provides insertion operators for basic types, and can be extended to support user-defined types as well.

Note
For more information on the Agent logger, see the logging chapter in the User Guide.

The following example demonstrates how to create a simple message and insert a basic data type:

int logType = 0;
rwsf::Logger logger = rwsf::LogManager()::getLogger();
msg << "This is a " << logType << "-type logger.";
msg.append("\n");
logger.info(msg);

Constructor & Destructor Documentation

rwsf::LogMessage::LogMessage ( )

Default constructor. Creates a blank message.

Member Function Documentation

void rwsf::LogMessage::append ( const std::string &  str)

Appends text to the log message.

virtual std::string rwsf::LogMessage::str ( ) const
virtual

Returns the prepared message as a string.

Friends And Related Function Documentation

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
bool   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
char   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
unsigned  char 
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
short   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
unsigned  short 
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
int   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
unsigned  int 
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
long   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
unsigned  long 
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
float   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
double   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
const char *   
)
related

Insertion operator for appending to a LogMessage instance.

rwsf::LogMessage & operator<< ( rwsf::LogMessage ,
const std::string &   
)
related

Insertion operator for appending to a LogMessage instance.

Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.