VSM C++ SDK
Vehicle Specific Modules SDK
log.h File Reference

Logging functionality for VSM. More...

#include <ugcs/vsm/exception.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdarg>
#include <string>
#include <memory>
#include <mutex>
#include <cinttypes>

Go to the source code of this file.

Classes

class  ugcs::vsm::Log
 Class for handling log output. More...
 
struct  ugcs::vsm::Log::Exception_dummy_struct
 Logging related exception. More...
 
class  ugcs::vsm::Log::Platform_logger
 Platform-specific logging handler. More...
 

Namespaces

 ugcs
 UGCS root namespace.
 
 ugcs::vsm
 All VSM SDK functionality resides in this namespace.
 

Macros

#define _LOG_WRITE_MSG(level, msg, ...)
 Write message to log. More...
 
#define LOG_DEBUG(msg, ...)   _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::DEBUGGING, msg, ## __VA_ARGS__)
 Write debug message to the application log. More...
 
#define LOG_DBG   LOG_DEBUG
 Short name. More...
 
#define LOG   LOG_DEBUG
 Short name. More...
 
#define LOG_INFO(msg, ...)   _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::INFO, msg, ## __VA_ARGS__)
 Write informational message to the application log. More...
 
#define LOG_WARNING(msg, ...)   _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::WARNING, msg, ## __VA_ARGS__)
 Write warning message to the application log. More...
 
#define LOG_WARN   LOG_WARNING
 Short name. More...
 
#define LOG_ERROR(msg, ...)   _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::ERROR, msg, ## __VA_ARGS__)
 Write error message to the application log. More...
 
#define LOG_ERR   LOG_ERROR
 Short name. More...
 

Detailed Description

Logging functionality for VSM.

Macro Definition Documentation

#define _LOG_WRITE_MSG (   level,
  msg,
  ... 
)
Value:
::ugcs::vsm::Log::Write_message(level, "[%s:%d] " msg, \
::ugcs::vsm::Log::Get_basename(__FILE__).c_str(), \
__LINE__, ## __VA_ARGS__)
static std::string Get_basename(const char *path)
Get base name (without leading directories) of file path.
static void Write_message(Level level, const char *msg,...)
Write formatted message to the log.

Write message to log.

For internal usage only.

#define LOG   LOG_DEBUG

Short name.

Examples:
async_workflow.cpp.
#define LOG_DBG   LOG_DEBUG

Short name.

#define LOG_DEBUG (   msg,
  ... 
)    _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::DEBUGGING, msg, ## __VA_ARGS__)

Write debug message to the application log.

#define LOG_ERR   LOG_ERROR

Short name.

#define LOG_ERROR (   msg,
  ... 
)    _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::ERROR, msg, ## __VA_ARGS__)

Write error message to the application log.

#define LOG_INFO (   msg,
  ... 
)    _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::INFO, msg, ## __VA_ARGS__)

Write informational message to the application log.

#define LOG_WARN   LOG_WARNING

Short name.

#define LOG_WARNING (   msg,
  ... 
)    _LOG_WRITE_MSG(::ugcs::vsm::Log::Level::WARNING, msg, ## __VA_ARGS__)

Write warning message to the application log.