qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ccLog Class Referenceabstract

Main log interface. More...

#include <ccLog.h>

Public Types

enum  MessageLevelFlags { LOG_STANDARD = 0 , LOG_DEBUG = 1 , LOG_WARNING = 2 , LOG_ERROR = 4 }
 Message level. More...
 

Public Member Functions

virtual ~ccLog ()
 Destructor.
 
virtual void logMessage (const QString &message, int level)=0
 Generic message logging method. More...
 

Static Public Member Functions

static ccLogTheInstance ()
 Returns the static and unique instance.
 
static void RegisterInstance (ccLog *logInstance)
 Registers a unique instance.
 
static void EnableMessageBackup (bool state)
 Enables the message backup system. More...
 
static void LogMessage (const QString &message, int level)
 Static shortcut to ccLog::logMessage.
 
static bool Print (const char *format,...)
 Prints out a formatted message in console. More...
 
static bool Print (const QString &message)
 QString version of ccLog::Print.
 
static bool PrintDebug (const char *format,...)
 Same as Print, but works only in debug mode. More...
 
static bool PrintDebug (const QString &message)
 QString version of ccLog::PrintDebug.
 
static bool Warning (const char *format,...)
 Prints out a formatted warning message in console. More...
 
static bool Warning (const QString &message)
 QString version of ccLog::Warning.
 
static bool WarningDebug (const char *format,...)
 Same as Warning, but works only in debug mode. More...
 
static bool WarningDebug (const QString &message)
 QString version of ccLog::WarningDebug.
 
static bool Error (const char *format,...)
 Display an error dialog with formatted message. More...
 
static bool Error (const QString &message)
 QString version of 'Error'.
 
static bool ErrorDebug (const char *format,...)
 Same as Error, but works only in debug mode. More...
 
static bool ErrorDebug (const QString &message)
 QString version of ccLog::ErrorDebug.
 

Detailed Description

Main log interface.

This interface is meant to be used as a unique (static) instance. It should be thread safe!

Member Enumeration Documentation

◆ MessageLevelFlags

Message level.

Enumerator
LOG_STANDARD 

Standard message (Print)

LOG_DEBUG 

Debug only flag

LOG_WARNING 

Warning message (Warning)

LOG_ERROR 

Error message (Error)

Member Function Documentation

◆ EnableMessageBackup()

void ccLog::EnableMessageBackup ( bool  state)
static

Enables the message backup system.

Stores the messages until a valid logging instance is registered.

◆ Error()

bool ccLog::Error ( const char *  format,
  ... 
)
static

Display an error dialog with formatted message.

Works just like the 'printf' command.

Returns
always return 'false'

◆ ErrorDebug()

bool ccLog::ErrorDebug ( const char *  format,
  ... 
)
static

Same as Error, but works only in debug mode.

Works just like the 'printf' command.

Returns
always return 'false'

◆ logMessage()

virtual void ccLog::logMessage ( const QString &  message,
int  level 
)
pure virtual

Generic message logging method.

To be implemented by child class.

Warning
MUST BE THREAD SAFE!
Parameters
messagemessage
levelmessage severity (see MessageLevelFlags)

◆ Print()

bool ccLog::Print ( const char *  format,
  ... 
)
static

Prints out a formatted message in console.

Works just like the 'printf' command.

Returns
always return 'true'

◆ PrintDebug()

bool ccLog::PrintDebug ( const char *  format,
  ... 
)
static

Same as Print, but works only in debug mode.

Works just like the 'printf' command.

Returns
always return 'true'

◆ Warning()

bool ccLog::Warning ( const char *  format,
  ... 
)
static

Prints out a formatted warning message in console.

Works just like the 'printf' command.

Returns
always return 'false'

◆ WarningDebug()

bool ccLog::WarningDebug ( const char *  format,
  ... 
)
static

Same as Warning, but works only in debug mode.

Works just like the 'printf' command.

Returns
always return 'false'

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