SBCLogEvent Class Reference

Log handling. More...

Event types

enum  Type {
  Analytics,
  StackHistory,
  Trace,
  Information,
  Warning,
  Error
}
 
static std::string getTypeString (SBCLogEvent::Type)
 
static SBCLogEvent::Type getTypeFromString (const std::string &typeString)
 

Constructors and destructor

 SBCLogEvent (SBCLogEvent::Type eventLevel, const std::string &filename, const std::string &functionName, const std::string &lineNumber, const std::string &descriptionMessage, const std::string &uuid="BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB")
 
 SBCLogEvent ()
 
virtual ~SBCLogEvent ()
 

Serialization

virtual bool isSerializable () const
 Returns true.
 
virtual void serialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
 Serializes the logEvent.
 
virtual void unserialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER)
 Unserializes the logEvent.
 

Accessors

const std::string & getTime ()
 Returns event date.
 
void setTime (const std::string &date)
 Sets event date.
 
Type getType ()
 Returns event type.
 
void setType (Type level)
 Sets event type.
 
const std::string & getDescriptionMessage ()
 Returns message that describe the event.
 
void setDescriptionMessage (const std::string &message)
 Sets a message describing the event.
 
const std::string & getFilename ()
 Returns ffleName where event is recorded.
 
void setFilename (const std::string &name)
 Sets fileName where event is recorded.
 
const std::string & getFileLine ()
 Returns line number where event is recorded.
 
void setFileLine (const std::string &line)
 Sets line number where event is recorded.
 
const std::string & getFunctionName ()
 Returns function name where event is recorded.
 
void setFunctionName (const std::string &name)
 Sets function name where event is recorded.
 
const std::string & getLibraryUUID ()
 Returns uuid of library where event is recorded.
 
void setLibraryUUID (const std::string &name)
 Sets uuid of library where event is recorded.
 

Formatting output

std::string toString (bool printTime=true, bool printLocation=true) const
 Returns event formated the following way: YYYY-MM-D_HH-MM-SS-mmm depending on the print options given as input. More...
 

Detailed Description

Every program needs to report/handle log conditions. This is done by managing an event stack where messages, with helpful runtime information, are put. A SBCLogEvent represent a logging event. An event is made up a date, a location (File / Line), a level and a description message

Member Enumeration Documentation

◆ Type

Enumerator
Analytics 

Used to add stack History.

StackHistory 

Used to add stack History.

Trace 

Used to trace subroutine calls.

Information 

Major event.

Warning 

Unusual event for application.

Error 

Error.

Member Function Documentation

◆ toString()

std::string SBCLogEvent::toString ( bool  printTime = true,
bool  printLocation = true 
) const
Parameters
printTimeset to true (default) if date is printed
printLocationset to true (default) if File/Line is printed