VR-Engage  2.3
Loading...
Searching...
No Matches
logger.h File Reference
Include dependency graph for logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __FILENAME__   (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
 
#define LOG_FATAL_STREAM(channel)
 
#define LOG_WARN_STREAM(channel)
 
#define LOG_INFO_STREAM(channel)
 
#define LOG_VERBOSE_STREAM(channel)
 
#define LOG_DEBUG_STREAM(channel)
 
#define LOG_FATAL(channel, format, ...)
 
#define LOG_WARN(channel, format, ...)
 
#define LOG_INFO(channel, format, ...)
 
#define LOG_VERBOSE(channel, format, ...)
 
#define LOG_DEBUG(channel, format, ...)
 
#define OBJCON_FATAL(channel)
 
#define OBJCON_WARN(channel)
 
#define OBJCON_INFO(channel)
 
#define OBJCON_VERBOSE(channel)
 
#define OBJCON_DEBUG(channel)
 

Functions

std::string UTIL_DLL logTimestamp ()
 
UTIL_DLL void logTimestamp (char *buf, size_t bufSize)
 
UTIL_DLL DtOutputStream & DtVreFatalStream (const std::string &channel, const std::string &function)
 
UTIL_DLL DtOutputStream & DtVreWarnStream (const std::string &channel, const std::string &function)
 
UTIL_DLL DtOutputStream & DtVreInfoStream (const std::string &channel, const std::string &function)
 
UTIL_DLL DtOutputStream & DtVreVerboseStream (const std::string &channel, const std::string &function)
 
UTIL_DLL DtOutputStream & DtVreDebugStream (const std::string &channel, const std::string &function)
 
UTIL_DLL void DtVreFatal (const std::string &channel, const std::string &function, const char *format,...)
 
UTIL_DLL void DtVreWarn (const std::string &channel, const std::string &function, const char *format,...)
 
UTIL_DLL void DtVreInfo (const std::string &channel, const std::string &function, const char *format,...)
 
UTIL_DLL void DtVreVerbose (const std::string &channel, const std::string &function, const char *format,...)
 
UTIL_DLL void DtVreDebug (const std::string &channel, const std::string &function, const char *format,...)
 

Macro Definition Documentation

◆ __FILENAME__

#define __FILENAME__   (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)

Macro to extract just the filename from a full path.

This macro extracts the filename from the full path in FILE Returns the filename without the directory path

◆ LOG_FATAL_STREAM

#define LOG_FATAL_STREAM ( channel)
Value:
DtVreFatalStream(channel, __FUNCTION__)
UTIL_DLL DtOutputStream & DtVreFatalStream(const std::string &channel, const std::string &function)
Logs a fatal error message.

Macro to log a fatal message to log files.

Parameters
channelThe logging channel/category to use

◆ LOG_WARN_STREAM

#define LOG_WARN_STREAM ( channel)
Value:
DtVreWarnStream(channel, __FUNCTION__)
UTIL_DLL DtOutputStream & DtVreWarnStream(const std::string &channel, const std::string &function)
Logs a warning message.

Macro to log a warning message to log files.

Parameters
channelThe logging channel/category to use

◆ LOG_INFO_STREAM

#define LOG_INFO_STREAM ( channel)
Value:
DtVreInfoStream(channel, __FUNCTION__)
UTIL_DLL DtOutputStream & DtVreInfoStream(const std::string &channel, const std::string &function)
Logs an informational message.

Macro to log an informational message to log files.

Parameters
channelThe logging channel/category to use

◆ LOG_VERBOSE_STREAM

#define LOG_VERBOSE_STREAM ( channel)
Value:
DtVreVerboseStream(channel, __FUNCTION__)
UTIL_DLL DtOutputStream & DtVreVerboseStream(const std::string &channel, const std::string &function)
Logs a verbose message (more detailed than info)

Macro to log a verbose message to log files.

Parameters
channelThe logging channel/category to use

◆ LOG_DEBUG_STREAM

#define LOG_DEBUG_STREAM ( channel)
Value:
DtVreDebugStream(channel, __FUNCTION__)
UTIL_DLL DtOutputStream & DtVreDebugStream(const std::string &channel, const std::string &function)
Logs a debug message.

Macro to log a debug message to log files.

Parameters
channelThe logging channel/category to use

◆ LOG_FATAL

#define LOG_FATAL ( channel,
format,
... )
Value:
DtVreFatal(channel, __FUNCTION__, format, ##__VA_ARGS__)
UTIL_DLL void DtVreFatal(const std::string &channel, const std::string &function, const char *format,...)
Logs a fatal message using printf-style formatting.

Macro to log a fatal message using printf-style formatting.

Parameters
channelThe logging channel/category to use.
formatA printf-style format string.

Referenced by makVre::DtVreSharedBase< SELF_T, SUPER_T >::create(), makVre::DtVreUniqueBase< SELF_T, SUPER_T >::create(), makVre::DtVreSharedBase< SELF_T, SUPER_T >::createVersion(), and makVre::DtLuaObject::setField().

◆ LOG_WARN

#define LOG_WARN ( channel,
format,
... )
Value:
DtVreWarn(channel, __FUNCTION__, format, ##__VA_ARGS__)
UTIL_DLL void DtVreWarn(const std::string &channel, const std::string &function, const char *format,...)
Logs a warning message using printf-style formatting.

Macro to log a warning message using printf-style formatting.

Parameters
channelThe logging channel/category to use.
formatA printf-style format string.

Referenced by makVre::DtTreeClass< SELF_T, SUPER_T >::addChild(), makVre::DtFactory< DtValueTransform >::addCreator(), makVre::DtFactory< DtValueTransform >::create(), makVre::DtInitTable::findData(), makVre::DtInitTable::findData(), makVre::DtTreeClass< SELF_T, SUPER_T >::removeChild(), and makVre::DtLuaObject::setField().

◆ LOG_INFO

#define LOG_INFO ( channel,
format,
... )
Value:
DtVreInfo(channel, __FUNCTION__, format, ##__VA_ARGS__)
UTIL_DLL void DtVreInfo(const std::string &channel, const std::string &function, const char *format,...)
Logs an informational message using printf-style formatting.

Macro to log an informational message using printf-style formatting.

Parameters
channelThe logging channel/category to use.
formatA printf-style format string.

Referenced by makVre::DtFactory< DtValueTransform >::addCreator(), and makVre::DtFactory< DtValueTransform >::removeCreator().

◆ LOG_VERBOSE

#define LOG_VERBOSE ( channel,
format,
... )
Value:
DtVreVerbose(channel, __FUNCTION__, format, ##__VA_ARGS__)
UTIL_DLL void DtVreVerbose(const std::string &channel, const std::string &function, const char *format,...)
Logs a verbose message using printf-style formatting.

Macro to log a verbose message using printf-style formatting.

Parameters
channelThe logging channel/category to use.
formatA printf-style format string.

Referenced by makVre::DtInitTable::findDataOr().

◆ LOG_DEBUG

#define LOG_DEBUG ( channel,
format,
... )
Value:
DtVreDebug(channel, __FUNCTION__, format, ##__VA_ARGS__)
UTIL_DLL void DtVreDebug(const std::string &channel, const std::string &function, const char *format,...)
Logs a debug message using printf-style formatting.

Macro to log a debug message using printf-style formatting.

Parameters
channelThe logging channel/category to use.
formatA printf-style format string.

Referenced by makVre::DtWeaponResourceLogic::lookUpField().

◆ OBJCON_FATAL

#define OBJCON_FATAL ( channel)
Value:
entity()->objectConsoleError() << "FATAL[" << channel << "] " << logTimestamp() << " " << __FUNCTION__ << ": "
std::string UTIL_DLL logTimestamp()
Generates a timestamp string for log messages.

Macro to log a fatal message to an entity's object console.

Parameters
channelThe logging channel/category to use

◆ OBJCON_WARN

#define OBJCON_WARN ( channel)
Value:
entity()->objectConsoleWarn() << "WARN[" << channel << "] " << logTimestamp() << " " << __FUNCTION__ << ": "

Macro to log a warning message to an entity's object console.

Parameters
channelThe logging channel/category to use

◆ OBJCON_INFO

#define OBJCON_INFO ( channel)
Value:
entity()->objectConsoleInfo() << "INFO[" << channel << "] " << logTimestamp() << " " << __FUNCTION__ << ": "

Macro to log an informational message to an entity's object console.

Parameters
channelThe logging channel/category to use

◆ OBJCON_VERBOSE

#define OBJCON_VERBOSE ( channel)
Value:
entity()->objectConsoleVerbose() << "VERBOSE[" << channel << "] " << logTimestamp() << " " << __FUNCTION__ << ": "

Macro to log a verbose message to an entity's object console.

Parameters
channelThe logging channel/category to use

◆ OBJCON_DEBUG

#define OBJCON_DEBUG ( channel)
Value:
entity()->objectConsoleDebug() << "DEBUG[" << channel << "] " << logTimestamp() << " " << __FUNCTION__ << ": "

Macro to log a debug message to an entity's object console.

Parameters
channelThe logging channel/category to use

Function Documentation

◆ logTimestamp() [1/2]

std::string UTIL_DLL logTimestamp ( )

Generates a timestamp string for log messages.

Returns
A formatted timestamp string for use in log messages

References UTIL_DLL.

◆ logTimestamp() [2/2]

UTIL_DLL void logTimestamp ( char * buf,
size_t bufSize )

Writes a timestamp string into a caller-provided buffer.

Prefer this overload in performance-sensitive paths to avoid heap allocation. The buffer must be at least 13 bytes to hold "HH:MM:SS.mmm" plus a null terminator.

Parameters
bufBuffer to write the timestamp into.
bufSizeSize of buf in bytes.

References UTIL_DLL.

◆ DtVreFatalStream()

UTIL_DLL DtOutputStream & DtVreFatalStream ( const std::string & channel,
const std::string & function )

Logs a fatal error message.

Parameters
channelThe logging channel/category to use
functionThe function name where the log originated
Returns
An output stream to write the message to

References UTIL_DLL.

◆ DtVreWarnStream()

UTIL_DLL DtOutputStream & DtVreWarnStream ( const std::string & channel,
const std::string & function )

Logs a warning message.

Parameters
channelThe logging channel/category to use
functionThe function name where the log originated
Returns
An output stream to write the message to

References UTIL_DLL.

◆ DtVreInfoStream()

UTIL_DLL DtOutputStream & DtVreInfoStream ( const std::string & channel,
const std::string & function )

Logs an informational message.

Parameters
channelThe logging channel/category to use
functionThe function name where the log originated
Returns
An output stream to write the message to

References UTIL_DLL.

◆ DtVreVerboseStream()

UTIL_DLL DtOutputStream & DtVreVerboseStream ( const std::string & channel,
const std::string & function )

Logs a verbose message (more detailed than info)

Parameters
channelThe logging channel/category to use
functionThe function name where the log originated
Returns
An output stream to write the message to

References UTIL_DLL.

◆ DtVreDebugStream()

UTIL_DLL DtOutputStream & DtVreDebugStream ( const std::string & channel,
const std::string & function )

Logs a debug message.

Parameters
channelThe logging channel/category to use
functionThe function name where the log originated
Returns
An output stream to write the message to

References UTIL_DLL.

◆ DtVreFatal()

UTIL_DLL void DtVreFatal ( const std::string & channel,
const std::string & function,
const char * format,
... )

Logs a fatal message using printf-style formatting.

Prefer this over LOG_FATAL in performance-sensitive code paths.

Parameters
channelThe logging channel/category to use.
functionThe function name where the log originated.
formatA printf-style format string.

References UTIL_DLL.

◆ DtVreWarn()

UTIL_DLL void DtVreWarn ( const std::string & channel,
const std::string & function,
const char * format,
... )

Logs a warning message using printf-style formatting.

Prefer this over LOG_WARN in performance-sensitive code paths.

Parameters
channelThe logging channel/category to use.
functionThe function name where the log originated.
formatA printf-style format string.

References UTIL_DLL.

◆ DtVreInfo()

UTIL_DLL void DtVreInfo ( const std::string & channel,
const std::string & function,
const char * format,
... )

Logs an informational message using printf-style formatting.

Prefer this over LOG_INFO in performance-sensitive code paths.

Parameters
channelThe logging channel/category to use.
functionThe function name where the log originated.
formatA printf-style format string.

References UTIL_DLL.

◆ DtVreVerbose()

UTIL_DLL void DtVreVerbose ( const std::string & channel,
const std::string & function,
const char * format,
... )

Logs a verbose message using printf-style formatting.

Prefer this over LOG_VERBOSE in performance-sensitive code paths.

Parameters
channelThe logging channel/category to use.
functionThe function name where the log originated.
formatA printf-style format string.

References UTIL_DLL.

◆ DtVreDebug()

UTIL_DLL void DtVreDebug ( const std::string & channel,
const std::string & function,
const char * format,
... )

Logs a debug message using printf-style formatting.

Prefer this over LOG_DEBUG in performance-sensitive code paths.

Parameters
channelThe logging channel/category to use.
functionThe function name where the log originated.
formatA printf-style format string.

References UTIL_DLL.