mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
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:
@@ -11,6 +11,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "traffic.h"
|
#include "traffic.h"
|
||||||
|
#include "utils.h"
|
||||||
#include <XPLM/XPLMPlanes.h>
|
#include <XPLM/XPLMPlanes.h>
|
||||||
#include <XPLM/XPLMPlugin.h>
|
#include <XPLM/XPLMPlugin.h>
|
||||||
#include <cstring>
|
#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);
|
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS",1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
INFO_LOG("XSwiftBus plugin starting");
|
||||||
std::strcpy(o_name, "XSwiftBus");
|
std::strcpy(o_name, "XSwiftBus");
|
||||||
std::strcpy(o_sig, "org.swift-project.xswiftbus");
|
std::strcpy(o_sig, "org.swift-project.xswiftbus");
|
||||||
std::strcpy(o_desc, "Allows swift to connect to X-Plane via D-Bus IPC");
|
std::strcpy(o_desc, "Allows swift to connect to X-Plane via D-Bus IPC");
|
||||||
|
|||||||
@@ -38,17 +38,17 @@ namespace XSwiftBus
|
|||||||
//! Print message to X-Plane log
|
//! Print message to X-Plane log
|
||||||
static void print(const std::string &filePath, int line, MsgType type, const std::string &message);
|
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
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user