Log starting of the XSwiftPlugin

Rational: If XPlane crashes before that log it is most likely something else
Remark: Logger macros using namespace, so they can be used outside XSwiftBus
This commit is contained in:
Klaus Basan
2019-08-22 17:33:07 +02:00
committed by Mat Sutcliffe
parent eed46f47a9
commit 3ea8f9c24f
2 changed files with 13 additions and 11 deletions

View File

@@ -11,6 +11,7 @@
#endif
#include "plugin.h"
#include "traffic.h"
#include "utils.h"
#include <XPLM/XPLMPlanes.h>
#include <XPLM/XPLMPlugin.h>
#include <cstring>
@@ -28,6 +29,7 @@ PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS",1);
#endif
INFO_LOG("XSwiftBus plugin starting");
std::strcpy(o_name, "XSwiftBus");
std::strcpy(o_sig, "org.swift-project.xswiftbus");
std::strcpy(o_desc, "Allows swift to connect to X-Plane via D-Bus IPC");

View File

@@ -38,17 +38,17 @@ namespace XSwiftBus
//! Print message to X-Plane log
static void print(const std::string &filePath, int line, MsgType type, const std::string &message);
};
//! Logger convenience macros
//! @{
// *INDENT-OFF*
#define DEBUG_LOG(msg) Logger::print(__FILE__, __LINE__, Logger::DebugMsg, msg)
#define DEBUG_LOG_C(msg, doLog) if (doLog) { Logger::print(__FILE__, __LINE__, Logger::DebugMsg, msg); }
#define INFO_LOG(msg) Logger::print(__FILE__, __LINE__, Logger::InfoMsg, msg)
#define WARNING_LOG(msg) Logger::print(__FILE__, __LINE__, Logger::WarningMsg, msg)
#define ERROR_LOG(msg) Logger::print(__FILE__, __LINE__, Logger::ErrorMsg, msg)
// *INDENT-ON*
//! @}
}
//! Logger convenience macros
//! @{
// *INDENT-OFF*
#define DEBUG_LOG(msg) XSwiftBus::Logger::print(__FILE__, __LINE__, XSwiftBus::Logger::DebugMsg, msg)
#define DEBUG_LOG_C(msg, doLog) if (doLog) { XSwiftBus::Logger::print(__FILE__, __LINE__, XSwiftBus::Logger::DebugMsg, msg); }
#define INFO_LOG(msg) XSwiftBus::Logger::print(__FILE__, __LINE__, XSwiftBus::Logger::InfoMsg, msg)
#define WARNING_LOG(msg) XSwiftBus::Logger::print(__FILE__, __LINE__, XSwiftBus::Logger::WarningMsg, msg)
#define ERROR_LOG(msg) XSwiftBus::Logger::print(__FILE__, __LINE__, XSwiftBus::Logger::ErrorMsg, msg)
// *INDENT-ON*
//! @}
#endif // guard