Add debug and log functions to ANSLIB

This commit is contained in:
2026-04-26 06:59:42 +10:00
parent 947398483a
commit f81737ffc6
9 changed files with 585 additions and 23 deletions

View File

@@ -327,7 +327,36 @@ namespace ANSCENTER
std::cerr << "SPDLogger::LogFatal - Exception: " << e.what() << std::endl;
}
}
}
// C facade — exported with stable C linkage so ANSLIB (and any other consumer)
// can resolve via GetProcAddress without coupling to the C++ class ABI.
// Each call delegates to the process-wide SPDLogger singleton; the magic-static
// inside GetInstance handles thread-safe one-time initialisation.
extern "C" {
ANSLICENSE_API void ANSLogger_LogInfo(const char* src, const char* msg, const char* file, int line) {
try {
ANSCENTER::SPDLogger::GetInstance("ANSLIB").LogInfo(
src ? src : "", msg ? msg : "", file ? file : "", line);
} catch (...) {}
}
ANSLICENSE_API void ANSLogger_LogError(const char* src, const char* msg, const char* file, int line) {
try {
ANSCENTER::SPDLogger::GetInstance("ANSLIB").LogError(
src ? src : "", msg ? msg : "", file ? file : "", line);
} catch (...) {}
}
ANSLICENSE_API void ANSLogger_LogFatal(const char* src, const char* msg, const char* file, int line) {
try {
ANSCENTER::SPDLogger::GetInstance("ANSLIB").LogFatal(
src ? src : "", msg ? msg : "", file ? file : "", line);
} catch (...) {}
}
}
namespace ANSCENTER
{
EngineType ANSCENTER::ANSLicenseHelper::CheckHardwareInformation()
{
ANS_DBG("HWInfo", "CheckHardwareInformation: starting hardware detection");