diff --git a/AI/Interfaces/C/src/Interface.cpp b/AI/Interfaces/C/src/Interface.cpp index edc9727f13d..ad5047159b1 100644 --- a/AI/Interfaces/C/src/Interface.cpp +++ b/AI/Interfaces/C/src/Interface.cpp @@ -18,25 +18,14 @@ CInterface::CInterface(int interfaceId, const struct SAIInterfaceCallback* callback) : interfaceId(interfaceId), callback(callback) { - char* logFileName = util_allocStrCatFSPath(2, "log", "interface-log.txt"); bool timeStamps = true; #ifdef DEBUG - int logLevel = SIMPLELOG_LEVEL_FINE; + int logLevel = LOG_LEVEL_NOTICE; #else - int logLevel = SIMPLELOG_LEVEL_ERROR; + int logLevel = LOG_LEVEL_ERROR; #endif - static const unsigned int logFilePath_sizeMax = 1024; - char logFilePath[logFilePath_sizeMax]; - // eg: "~/.spring/AI/Interfaces/C/log/interface-log.txt" - bool ok = callback->DataDirs_locatePath(interfaceId, - logFilePath, logFilePath_sizeMax, - logFileName, true, true, false, false); - if (!ok) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, - "Failed locating the log file %s.", logFileName); - } - simpleLog_init(logFilePath, timeStamps, logLevel, false); + simpleLog_initcallback(interfaceId, "C Interface", callback->Log_logsl, LOG_LEVEL_INFO); const char* const myShortName = callback->AIInterface_Info_getValueByKey(interfaceId, AI_INTERFACE_PROPERTY_SHORT_NAME); @@ -45,11 +34,7 @@ CInterface::CInterface(int interfaceId, simpleLog_log("This is the log-file of the %s v%s AI Interface", myShortName, myVersion); - simpleLog_log("Using read/write data-directory: %s", - callback->DataDirs_getWriteableDir(interfaceId)); - simpleLog_log("Using log file: %s", logFileName); - FREE(logFileName); } //LevelOfSupport CInterface::GetLevelOfSupportFor( @@ -212,7 +197,7 @@ void CInterface::reportInterfaceFunctionError(const std::string& libFilePath, } void CInterface::reportError(const std::string& msg) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, msg.c_str()); + simpleLog_logL(LOG_LEVEL_ERROR, msg.c_str()); } diff --git a/AI/Interfaces/Java/src/main/native/InterfaceExport.c b/AI/Interfaces/Java/src/main/native/InterfaceExport.c index cae53cf3aa5..66f7a5d05b4 100644 --- a/AI/Interfaces/Java/src/main/native/InterfaceExport.c +++ b/AI/Interfaces/Java/src/main/native/InterfaceExport.c @@ -69,7 +69,7 @@ EXPORT(int) initStatic(int _interfaceId, ddw, ddw_sizeMax, "", true, true, true, false); if (!ddwFetched) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed locating writable data-dir \"%s\"", ddw); } int p; @@ -83,61 +83,19 @@ EXPORT(int) initStatic(int _interfaceId, } } - // ### try to fetch the log-level from the properties ### - int logLevel = SIMPLELOG_LEVEL_NORMAL; - const char* logLevel_str = - util_map_getValueByKey(numProps, propKeys, (const char**)propValues, - "log.level"); - if (logLevel_str != NULL) { - int logLevel_tmp = atoi(logLevel_str); - if (logLevel_tmp >= SIMPLELOG_LEVEL_ERROR - && logLevel_tmp <= SIMPLELOG_LEVEL_FINEST) { - logLevel = logLevel_tmp; - } - } - - // ### try to fetch whether to use time-stamps from the properties ### - bool useTimeStamps = true; - const char* useTimeStamps_str = - util_map_getValueByKey(numProps, propKeys, (const char**)propValues, - "log.useTimeStamps"); - if (useTimeStamps_str != NULL) { - useTimeStamps = util_strToBool(useTimeStamps_str); - } - - // ### init the log file ### - char* logFile = util_allocStrCpy( - util_map_getValueByKey(numProps, propKeys, (const char**)propValues, - "log.file")); - if (logFile == NULL) { - logFile = util_allocStrCatFSPath(2, "log", MY_LOG_FILE); - } - - static const unsigned int logFilePath_sizeMax = 1024; - char logFilePath[logFilePath_sizeMax]; - // eg: "~/.spring/AI/Interfaces/Java/${INTERFACE_PROPERTIES_FILE}" - bool logFileFetched = callback->DataDirs_locatePath(interfaceId, - logFilePath, logFilePath_sizeMax, - logFile, true, true, false, false); - - if (logFileFetched) { - simpleLog_init(logFilePath, useTimeStamps, logLevel, false); - } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, - "Failed initializing log-file \"%s\"", logFileFetched); - } + simpleLog_initcallback(_interfaceId, "Java Interface", callback->Log_logsl, LOG_LEVEL_INFO); // log settings loaded from interface config file if (propFileFetched) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "settings loaded from: %s", + simpleLog_logL(LOG_LEVEL_NOTICE, "settings loaded from: %s", propFilePath); int p; for (p=0; p < numProps; ++p) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "\t%i: %s = %s", + simpleLog_logL(LOG_LEVEL_NOTICE, "\t%i: %s = %s", p, propKeys[p], propValues[p]); } } else { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "settings NOT loaded from: %s", + simpleLog_logL(LOG_LEVEL_NOTICE, "settings NOT loaded from: %s", propFilePath); } @@ -147,16 +105,14 @@ EXPORT(int) initStatic(int _interfaceId, callback->DataDirs_getWriteableDir(interfaceId)); simpleLog_log("Using config-file: %s", propFilePath); - FREE(logFile); - // initialize Java part of the interface success = java_initStatic(interfaceId, callback); // load the JVM success = success && java_preloadJNIEnv(); if (success) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "Initialization successfull."); + simpleLog_logL(LOG_LEVEL_NOTICE, "Initialization successfull."); } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "Initialization failed."); + simpleLog_logL(LOG_LEVEL_ERROR, "Initialization failed."); } return success ? 0 : -1; diff --git a/AI/Interfaces/Java/src/main/native/JavaBridge.c b/AI/Interfaces/Java/src/main/native/JavaBridge.c index 1b6a9f1f791..f5dfb5b9dbe 100644 --- a/AI/Interfaces/Java/src/main/native/JavaBridge.c +++ b/AI/Interfaces/Java/src/main/native/JavaBridge.c @@ -149,7 +149,7 @@ static size_t java_createClassPath(char* classPathStr, const size_t classPathStr bool ok = util_getParentDir(mainJarPath); if (!ok) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Retrieving the parent dir of the path to AIInterface.jar (%s) failed.", mainJarPath); } @@ -256,7 +256,7 @@ static size_t java_createAIClassPath(const char* shortName, const char* version, shortName, version, SKIRMISH_AI_PROPERTY_DATA_DIR); if (skirmDD == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Retrieving the data-dir of Skirmish AI %s-%s failed.", shortName, version); } @@ -376,13 +376,13 @@ static jobject java_createAIClassLoader(JNIEnv* env, char* str_fileUrl = util_allocStrCat(2, FILE_URL_PREFIX, classPathParts[cpp]); // TODO: check/test if this is allowed/ok FREE(classPathParts[cpp]); - simpleLog_logL(SIMPLELOG_LEVEL_FINE, + simpleLog_logL(LOG_LEVEL_INFO, "Skirmish AI %s %s class-path part %i: \"%s\"", shortName, version, cpp, str_fileUrl); jobject jurl_fileUrl = jniUtil_createURLObject(env, str_fileUrl); FREE(str_fileUrl); if (jurl_fileUrl == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Skirmish AI %s %s class-path part %i (\"%s\"): failed to create a URL", shortName, version, cpp, str_fileUrl); o_cppURLs = NULL; @@ -390,7 +390,7 @@ static jobject java_createAIClassLoader(JNIEnv* env, } const bool inserted = jniUtil_insertURLIntoArray(env, o_cppURLs, cpp, jurl_fileUrl); if (!inserted) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Skirmish AI %s %s class-path part %i (\"%s\"): failed to insert", shortName, version, cpp, str_fileUrl); o_cppURLs = NULL; @@ -437,12 +437,12 @@ static bool java_readJvmCfgFile(struct Properties* props) { props->size = util_parsePropertiesFile(jvmPropFile, props->keys, props->values, props_sizeMax); read = true; - simpleLog_logL(SIMPLELOG_LEVEL_FINE, + simpleLog_logL(LOG_LEVEL_INFO, "JVM: arguments loaded from: %s", jvmPropFile); } else { props->size = 0; read = false; - simpleLog_logL(SIMPLELOG_LEVEL_FINE, + simpleLog_logL(LOG_LEVEL_INFO, "JVM: arguments NOT loaded from: %s", jvmPropFile); } @@ -468,7 +468,7 @@ static bool java_createNativeLibsPath(char* libraryPath, const size_t libraryPat callback->AIInterface_Info_getValueByKey(interfaceId, AI_INTERFACE_PROPERTY_DATA_DIR); if (dd_r == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Unable to find read-only data-dir."); return false; } else { @@ -479,7 +479,7 @@ static bool java_createNativeLibsPath(char* libraryPath, const size_t libraryPat char* dd_lib_r = callback->DataDirs_allocatePath(interfaceId, NATIVE_LIBS_DIR, false, false, true, false); if (dd_lib_r == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "Unable to find read-only native libs data-dir (optional): %s", NATIVE_LIBS_DIR); } else { @@ -493,7 +493,7 @@ static bool java_createNativeLibsPath(char* libraryPath, const size_t libraryPat callback->AIInterface_Info_getValueByKey(interfaceId, AI_INTERFACE_PROPERTY_DATA_DIR_COMMON); if (dd_r_common == NULL || !util_fileExists(dd_r_common)) { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "Unable to find common read-only data-dir (optional)."); } else { STRCAT_T(libraryPath, libraryPath_sizeMax, ENTRY_DELIM); @@ -505,7 +505,7 @@ static bool java_createNativeLibsPath(char* libraryPath, const size_t libraryPat char* dd_lib_r_common = callback->DataDirs_allocatePath(interfaceId, NATIVE_LIBS_DIR, false, false, true, true); if (dd_lib_r_common == NULL || !util_fileExists(dd_lib_r_common)) { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "Unable to find common read-only native libs data-dir (optional)."); } else { STRCAT_T(libraryPath, libraryPath_sizeMax, ENTRY_DELIM); @@ -534,7 +534,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru } } } - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "JVM: JNI version: %#x", jniVersion); + simpleLog_logL(LOG_LEVEL_INFO, "JVM: JNI version: %#x", jniVersion); vm_args->version = jniVersion; // ### check if debug related JVM options should be used ### @@ -583,11 +583,11 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru } } if (ignoreUnrecognized) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, + simpleLog_logL(LOG_LEVEL_INFO, "JVM: ignoring unrecognized options"); vm_args->ignoreUnrecognized = JNI_TRUE; } else { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, + simpleLog_logL(LOG_LEVEL_INFO, "JVM: NOT ignoring unrecognized options"); vm_args->ignoreUnrecognized = JNI_FALSE; } @@ -598,7 +598,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru char* classPath = util_allocStr(classPath_sizeMax); // ..., autogenerate it ... if (!java_createClassPath(classPath, classPath_sizeMax)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed creating Java class-path."); FREE(classPath); return false; @@ -626,7 +626,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru char* libraryPath = util_allocStr(libraryPath_sizeMax); // ..., autogenerate it ... if (!java_createNativeLibsPath(libraryPath, libraryPath_sizeMax)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed creating Java library-path."); FREE(libraryPath); return false; @@ -680,7 +680,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru } } else { // ### ... or set default ones, if the JVM config file was not found ### - simpleLog_logL(SIMPLELOG_LEVEL_WARNING, "JVM: properties file ("JVM_PROPERTIES_FILE") not found; using default options."); + simpleLog_logL(LOG_LEVEL_WARNING, "JVM: properties file ("JVM_PROPERTIES_FILE") not found; using default options."); strOptions[op++] = "-Xms4M"; strOptions[op++] = "-Xmx64M"; @@ -707,7 +707,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru vm_args->options = (struct JavaVMOption*) calloc(options_size, sizeof(struct JavaVMOption)); // fill strOptions into the JVM options - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "JVM: options:", options_size); + simpleLog_logL(LOG_LEVEL_INFO, "JVM: options:", options_size); char* dd_rw = callback->DataDirs_allocatePath(interfaceId, "", true, true, true, false); size_t i; @@ -720,7 +720,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru if (strlen(tmpOptionString) > 0) { vm_args->options[nOptions].optionString = tmpOptionString; vm_args->options[nOptions].extraInfo = NULL; - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "JVM option %ul: %s", nOptions, tmpOptionString); + simpleLog_logL(LOG_LEVEL_INFO, "JVM option %ul: %s", nOptions, tmpOptionString); nOptions++; } else { free(tmpOptionString); @@ -733,7 +733,7 @@ static bool java_createJavaVMInitArgs(struct JavaVMInitArgs* vm_args, const stru FREE(dd_rw); FREE(classPathOpt); FREE(libraryPathOpt); - simpleLog_logL(SIMPLELOG_LEVEL_FINE, ""); + simpleLog_logL(LOG_LEVEL_INFO, ""); return true; } @@ -744,12 +744,12 @@ static JNIEnv* java_reattachCurrentThread() { JNIEnv* env = NULL; - simpleLog_logL(SIMPLELOG_LEVEL_FINEST, "Reattaching current thread..."); + simpleLog_logL(LOG_LEVEL_DEBUG, "Reattaching current thread..."); //const jint res = (*g_jvm)->AttachCurrentThreadAsDaemon(g_jvm, (void**) &env, NULL); const jint res = (*g_jvm)->AttachCurrentThread(g_jvm, (void**) &env, NULL); if (res != 0) { env = NULL; - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed attaching JVM to current thread(2): %i - %s", res, jniUtil_getJniRetValDescription(res)); } @@ -762,7 +762,7 @@ static JNIEnv* java_getJNIEnv() { JNIEnv* ret = NULL; if (g_jvm == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "Creating the JVM."); + simpleLog_logL(LOG_LEVEL_INFO, "Creating the JVM."); JNIEnv* env = NULL; JavaVM* jvm = NULL; @@ -770,7 +770,7 @@ static JNIEnv* java_getJNIEnv() { jint res = 0; if (!java_createJavaVMInitArgs(&vm_args, jvmCfgProps)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed initializing JVM init-arguments."); goto end; } @@ -782,7 +782,7 @@ static JNIEnv* java_getJNIEnv() { // creating a new one for hte same process impossible // (a (SUN?) JVM limitation), we have to do it this way, // to support /aireload and /aicontrol for Java Skirmish AIs. - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "looking for existing JVMs ..."); + simpleLog_logL(LOG_LEVEL_INFO, "looking for existing JVMs ..."); jsize numJVMsFound = 0; // jint JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs); @@ -793,20 +793,20 @@ static JNIEnv* java_getJNIEnv() { res = JNI_GetCreatedJavaVMs_f(&jvm, maxVmsToFind, &numJVMsFound); if (res != 0) { jvm = NULL; - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed fetching list of running JVMs: %i - %s", res, jniUtil_getJniRetValDescription(res)); goto end; } - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "number of existing JVMs: %i", numJVMsFound); + simpleLog_logL(LOG_LEVEL_INFO, "number of existing JVMs: %i", numJVMsFound); if (numJVMsFound > 0) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "using an already running JVM."); + simpleLog_logL(LOG_LEVEL_INFO, "using an already running JVM."); } else { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "creating JVM..."); + simpleLog_logL(LOG_LEVEL_INFO, "creating JVM..."); res = JNI_CreateJavaVM_f(&jvm, (void**) &env, &vm_args); if (res != 0 || (*env)->ExceptionCheck(env)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to create Java VM: %i - %s", res, jniUtil_getJniRetValDescription(res)); goto end; @@ -826,7 +826,7 @@ static JNIEnv* java_getJNIEnv() { if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); } - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to attach JVM to current thread: %i - %s", res, jniUtil_getJniRetValDescription(res)); goto end; @@ -835,7 +835,7 @@ static JNIEnv* java_getJNIEnv() { end: if (env == NULL || jvm == NULL || (*env)->ExceptionCheck(env) || res != 0) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "JVM: Failed creating."); + simpleLog_logL(LOG_LEVEL_ERROR, "JVM: Failed creating."); if (env != NULL && (*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); } @@ -861,7 +861,7 @@ static JNIEnv* java_getJNIEnv() { bool java_unloadJNIEnv() { if (g_jvm != NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_FINE, "JVM: Unloading ..."); + simpleLog_logL(LOG_LEVEL_INFO, "JVM: Unloading ..."); //JNIEnv* env = java_getJNIEnv(); @@ -874,7 +874,7 @@ bool java_unloadJNIEnv() { if ((*g_jniEnv)->ExceptionCheck(g_jniEnv)) { (*g_jniEnv)->ExceptionDescribe(g_jniEnv); } - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "JVM: Can not Attach to the current thread: %i - %s", res, jniUtil_getJniRetValDescription(res)); return false; @@ -882,7 +882,7 @@ bool java_unloadJNIEnv() { const jint res = (*g_jvm)->DetachCurrentThread(g_jvm); if (res != 0) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "JVM: Failed detaching current thread: %i - %s", res, jniUtil_getJniRetValDescription(res)); return false; @@ -894,12 +894,12 @@ bool java_unloadJNIEnv() { // commands on java AIs /*res = (*g_jvm)->DestroyJavaVM(g_jvm); if (res != 0) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "JVM: Failed destroying: %i - %s", res, jniUtil_getJniRetValDescription(res)); return false; } else { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "JVM: Successfully destroyed"); g_jvm = NULL; }*/ @@ -958,12 +958,12 @@ bool java_initStatic(int _interfaceId, char jrePath[jrePath_sizeMax]; bool jreFound = GetJREPath(jrePath, jrePath_sizeMax, jreLocationFile, NULL); if (!jreFound) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed locating a JRE installation" ", you may specify the JAVA_HOME env var."); return false; } else { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "Using JRE (can be changed with JAVA_HOME): %s", jrePath); } FREE(jreLocationFile); @@ -983,24 +983,24 @@ bool java_initStatic(int _interfaceId, bool jvmLibFound = GetJVMPath(jrePath, jvmType, jvmLibPath, jvmLibPath_sizeMax, NULL); if (!jvmLibFound) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed locating the %s version of the JVM, please contact spring devs.", jvmType); return false; } jvmSharedLib = sharedLib_load(jvmLibPath); if (!sharedLib_isLoaded(jvmSharedLib)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to load the JVM at \"%s\".", jvmLibPath); return false; } else { - simpleLog_logL(SIMPLELOG_LEVEL_NORMAL, + simpleLog_logL(LOG_LEVEL_NOTICE, "Successfully loaded the JVM shared library at \"%s\".", jvmLibPath); JNI_GetDefaultJavaVMInitArgs_f = (JNI_GetDefaultJavaVMInitArgs_t*) sharedLib_findAddress(jvmSharedLib, "JNI_GetDefaultJavaVMInitArgs"); if (JNI_GetDefaultJavaVMInitArgs_f == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to load the JVM, function \"%s\" not exported.", "JNI_GetDefaultJavaVMInitArgs"); return false; } @@ -1008,7 +1008,7 @@ bool java_initStatic(int _interfaceId, JNI_CreateJavaVM_f = (JNI_CreateJavaVM_t*) sharedLib_findAddress(jvmSharedLib, "JNI_CreateJavaVM"); if (JNI_CreateJavaVM_f == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to load the JVM, function \"%s\" not exported.", "JNI_CreateJavaVM"); return false; } @@ -1016,7 +1016,7 @@ bool java_initStatic(int _interfaceId, JNI_GetCreatedJavaVMs_f = (JNI_GetCreatedJavaVMs_t*) sharedLib_findAddress(jvmSharedLib, "JNI_GetCreatedJavaVMs"); if (JNI_GetCreatedJavaVMs_f == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to load the JVM, function \"%s\" not exported.", "JNI_GetCreatedJavaVMs"); return false; } @@ -1114,11 +1114,11 @@ static bool java_loadSkirmishAI(JNIEnv* env, const bool implementsAIInt = (bool) (*env)->IsAssignableFrom(env, cls_ai, g_cls_ai_int); bool hasException = (*env)->ExceptionCheck(env); if (!implementsAIInt || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "AI class not assignable from interface "INT_AI": %s", className); - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "possible reasons (this list could be incomplete):"); - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "* "INT_AI" interface not implemented"); - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "* The AI is not compiled for the Java AI Interface version in use"); + simpleLog_logL(LOG_LEVEL_ERROR, "possible reasons (this list could be incomplete):"); + simpleLog_logL(LOG_LEVEL_ERROR, "* "INT_AI" interface not implemented"); + simpleLog_logL(LOG_LEVEL_ERROR, "* The AI is not compiled for the Java AI Interface version in use"); if (hasException) { (*env)->ExceptionDescribe(env); } @@ -1133,7 +1133,7 @@ static bool java_loadSkirmishAI(JNIEnv* env, jobject o_local_ai = (*env)->NewObject(env, cls_ai, m_ai_ctor); hasException = (*env)->ExceptionCheck(env); if (!o_local_ai || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed fetching AI instance for class: %s", className); if (hasException) { (*env)->ExceptionDescribe(env); @@ -1190,7 +1190,7 @@ bool java_initSkirmishAIClass( skirmishAiImpl_size++; } } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Class loading failed for class: %s", className); } } else { diff --git a/AI/Interfaces/Java/src/main/native/JniUtil.c b/AI/Interfaces/Java/src/main/native/JniUtil.c index 7d1307b0aac..909afc70bd3 100644 --- a/AI/Interfaces/Java/src/main/native/JniUtil.c +++ b/AI/Interfaces/Java/src/main/native/JniUtil.c @@ -37,7 +37,7 @@ const char* jniUtil_getJniRetValDescription(const jint retVal) { bool jniUtil_checkException(JNIEnv* env, const char* const errorMsg) { if ((*env)->ExceptionCheck(env)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, errorMsg); + simpleLog_logL(LOG_LEVEL_ERROR, errorMsg); (*env)->ExceptionDescribe(env); return true; } @@ -52,7 +52,7 @@ jclass jniUtil_findClass(JNIEnv* env, const char* const className) { res = (*env)->FindClass(env, className); const bool hasException = (*env)->ExceptionCheck(env); if (res == NULL || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "Class not found: \"%s\"", className); + simpleLog_logL(LOG_LEVEL_ERROR, "Class not found: \"%s\"", className); if (hasException) { (*env)->ExceptionDescribe(env); } @@ -72,7 +72,7 @@ jobject jniUtil_makeGlobalRef(JNIEnv* env, jobject localObject, const char* objD // but only if explicitly deleted with DeleteGlobalRef res = (*env)->NewGlobalRef(env, localObject); if ((*env)->ExceptionCheck(env)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to make %s a global reference.", ((objDesc == NULL) ? "" : objDesc)); (*env)->ExceptionDescribe(env); @@ -89,7 +89,7 @@ bool jniUtil_deleteGlobalRef(JNIEnv* env, jobject globalObject, // so it will be garbage collected (*env)->DeleteGlobalRef(env, globalObject); if ((*env)->ExceptionCheck(env)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed to delete global reference %s.", ((objDesc == NULL) ? "" : objDesc)); (*env)->ExceptionDescribe(env); @@ -107,7 +107,7 @@ jmethodID jniUtil_getMethodID(JNIEnv* env, jclass cls, res = (*env)->GetMethodID(env, cls, name, signature); const bool hasException = (*env)->ExceptionCheck(env); if (res == NULL || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "Method not found: %s(%s)", + simpleLog_logL(LOG_LEVEL_ERROR, "Method not found: %s(%s)", name, signature); if (hasException) { (*env)->ExceptionDescribe(env); @@ -126,7 +126,7 @@ jmethodID jniUtil_getStaticMethodID(JNIEnv* env, jclass cls, res = (*env)->GetStaticMethodID(env, cls, name, signature); const bool hasException = (*env)->ExceptionCheck(env); if (res == NULL || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, "Method not found: %s(%s)", + simpleLog_logL(LOG_LEVEL_ERROR, "Method not found: %s(%s)", name, signature); if (hasException) { (*env)->ExceptionDescribe(env); @@ -175,7 +175,7 @@ jobject jniUtil_createURLObject(JNIEnv* env, const char* const url) { if (jniUtil_checkException(env, "Failed creating Java URL.")) { jurl = NULL; } } } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed creating Java URL; URL class not initialized."); } @@ -194,7 +194,7 @@ jobjectArray jniUtil_createURLArray(JNIEnv* env, size_t size) { jurlArr = (*env)->NewObjectArray(env, size, g_cls_url, NULL); if (jniUtil_checkException(env, "Failed creating URL[].")) { jurlArr = NULL; } } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed creating Java URL[]; URL class not initialized."); } @@ -250,7 +250,7 @@ jobject jniUtil_createURLClassLoader(JNIEnv* env, jobject urlArray) { classLoader = (*env)->NewObject(env, g_cls_urlClassLoader, g_m_urlClassLoader_ctor, urlArray); if (jniUtil_checkException(env, "Failed creating class-loader.")) { return NULL; } } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed creating class-loader; class-loader class not initialized."); } @@ -271,7 +271,7 @@ jclass jniUtil_findClassThroughLoader(JNIEnv* env, jobject classLoader, const ch cls = (*env)->CallObjectMethod(env, classLoader, g_m_urlClassLoader_findClass, jstr_className); const bool hasException = (*env)->ExceptionCheck(env); if (cls == NULL || hasException) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Class not found \"%s\"", className); if (hasException) { (*env)->ExceptionDescribe(env); @@ -279,7 +279,7 @@ jclass jniUtil_findClassThroughLoader(JNIEnv* env, jobject classLoader, const ch cls = NULL; } } else { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, + simpleLog_logL(LOG_LEVEL_ERROR, "Failed finding class; class-loader class not initialized."); } diff --git a/AI/Interfaces/Java/src/main/native/JvmLocater_common.c b/AI/Interfaces/Java/src/main/native/JvmLocater_common.c index c8099b3400a..25ba41150d5 100644 --- a/AI/Interfaces/Java/src/main/native/JvmLocater_common.c +++ b/AI/Interfaces/Java/src/main/native/JvmLocater_common.c @@ -52,10 +52,10 @@ bool GetJREPathFromConfig(char* path, size_t pathSize, const char* configFile) JRE_PATH_PROPERTY); if (jvmLocation == NULL) { - simpleLog_logL(SIMPLELOG_LEVEL_FINEST, "JRE not found in config file!"); + simpleLog_logL(LOG_LEVEL_DEBUG, "JRE not found in config file!"); return false; } else { - simpleLog_logL(SIMPLELOG_LEVEL_FINER, "JRE found in config file!"); + simpleLog_logL(LOG_LEVEL_NOTICE, "JRE found in config file!"); STRCPY_T(path, pathSize, jvmLocation); return true; } @@ -81,7 +81,7 @@ bool GetJREPathFromConfig(char* path, size_t pathSize, const char* configFile) line_size--; } - simpleLog_logL(SIMPLELOG_LEVEL_FINER, + simpleLog_logL(LOG_LEVEL_NOTICE, "Fetched JRE location from \"%s\"!", configFile); if (line_size > 0 && *line == '/') { @@ -115,7 +115,7 @@ bool GetJREPathFromEnvVars(char* path, size_t pathSize, const char* arch) if (envPath != NULL) { found = GetJREPathFromBase(path, pathSize, envPath, arch); if (found) { - simpleLog_logL(SIMPLELOG_LEVEL_FINER, "JRE found in env var \"%s\"!", possLoc[l]); + simpleLog_logL(LOG_LEVEL_NOTICE, "JRE found in env var \"%s\"!", possLoc[l]); goto locSearchEnd; } } @@ -162,7 +162,7 @@ bool GetJREPath(char* path, size_t pathSize, const char* configFile, int main(int argc, const char* argv[]) { - simpleLog_init(NULL, false, SIMPLELOG_LEVEL_FINEST, false); + //simpleLog_init(NULL, false, LOG_LEVEL_DEBUG, false); static const size_t path_sizeMax = 1024; char path[path_sizeMax]; diff --git a/AI/Interfaces/Java/src/main/native/JvmLocater_linux.c b/AI/Interfaces/Java/src/main/native/JvmLocater_linux.c index d41bd27358d..ee462240496 100644 --- a/AI/Interfaces/Java/src/main/native/JvmLocater_linux.c +++ b/AI/Interfaces/Java/src/main/native/JvmLocater_linux.c @@ -144,7 +144,7 @@ static size_t ExecFileSystemGlob(char** pathHits, size_t pathHits_sizeMax, line_size--; } - simpleLog_logL(SIMPLELOG_LEVEL_FINEST, + simpleLog_logL(LOG_LEVEL_DEBUG, "glob-hit \"%s\"!", line); if (line_size > 0 && *line == '/') { @@ -181,7 +181,7 @@ static bool GetJREPathInCommonLocations(char* path, size_t pathSize, const char* for (g=0; g < globHits_size; ++g) { found = GetJREPathFromBase(path, pathSize, globHits[g], arch); if (found) { - simpleLog_logL(SIMPLELOG_LEVEL_FINER, + simpleLog_logL(LOG_LEVEL_NOTICE, "JRE found common location env var \"%s\"!", possLoc[l]); goto locSearchEnd; @@ -224,13 +224,13 @@ static bool GetJREPathWhichJava(char* path, size_t pathSize, const char* arch) line_size--; } - simpleLog_logL(SIMPLELOG_LEVEL_FINEST, + simpleLog_logL(LOG_LEVEL_DEBUG, "which line \"%s\"!", line); if (line_size > suf_size && strcmp(line+(line_size-suf_size), suf) == 0) { // line ends with suf - simpleLog_logL(SIMPLELOG_LEVEL_FINER, + simpleLog_logL(LOG_LEVEL_NOTICE, "JRE found with `which java`!"); // remove suf *(line+(line_size-suf_size)) = '\0'; diff --git a/AI/Interfaces/Java/src/main/native/JvmLocater_windows.c b/AI/Interfaces/Java/src/main/native/JvmLocater_windows.c index 0a132cf0c00..b2a7d3a6dcb 100644 --- a/AI/Interfaces/Java/src/main/native/JvmLocater_windows.c +++ b/AI/Interfaces/Java/src/main/native/JvmLocater_windows.c @@ -162,7 +162,7 @@ static bool GetJREPathFromRegistry(char* path, size_t pathSize, const char* arch RegCloseKey(key); RegCloseKey(subkey); - simpleLog_logL(SIMPLELOG_LEVEL_FINER, "JRE found in registry!"); + simpleLog_logL(LOG_LEVEL_NOTICE, "JRE found in registry!"); return true; } diff --git a/AI/Wrappers/CUtils/SimpleLog.c b/AI/Wrappers/CUtils/SimpleLog.c index 552235e8f53..41cb3b616f6 100644 --- a/AI/Wrappers/CUtils/SimpleLog.c +++ b/AI/Wrappers/CUtils/SimpleLog.c @@ -25,28 +25,14 @@ #include // for file IO #include // calloc(), exit() #include // strlen(), strcpy() -#include // for fetching current time #include // var-arg support #define SIMPLELOG_OUTPUTBUFFER_SIZE 2048 -#define logFileName_sizeMax 2048 -static bool logFileInitialized = false; -static char logFileName[logFileName_sizeMax]; -static bool useTimeStamps; -static int logLevel; - -static char* simpleLog_createTimeStamp() { - - time_t now; - now = time(&now); - struct tm* myTime = localtime(&now); - unsigned int maxTimeStampSize = 32; - char* timeStamp = (char*) calloc(maxTimeStampSize + 1, sizeof(char)); - strftime(timeStamp, maxTimeStampSize, "%c", myTime); - - return timeStamp; -} +static int logLevel = LOG_LEVEL_INFO; +static logfunction logFunction = NULL; +static char logSection[32] = ""; +static int interfaceid = 0; static void simpleLog_out(int level, const char* msg) { @@ -54,39 +40,16 @@ static void simpleLog_out(int level, const char* msg) { return; } - static char outBuffer[SIMPLELOG_OUTPUTBUFFER_SIZE]; - - // format the message - const char* logLevel_str = simpleLog_levelToStr(level); - if (useTimeStamps) { - char* timeStamp = simpleLog_createTimeStamp(); - SNPRINTF(outBuffer, SIMPLELOG_OUTPUTBUFFER_SIZE, "%s / %s(%i): %s\n", - timeStamp, logLevel_str, level, msg); - free(timeStamp); - timeStamp = NULL; - } else { - SNPRINTF(outBuffer, SIMPLELOG_OUTPUTBUFFER_SIZE, "%s(%i): %s\n", - logLevel_str, level, msg); - } - - // try to open the log file - FILE* file = NULL; - if (logFileInitialized) { - file = FOPEN(logFileName, "a"); + if (logFunction != NULL) { + logFunction(interfaceid, logSection, level, msg); + return; } - // print the message - if (file != NULL) { - FPRINTF(file, "%s", outBuffer); - fclose(file); - file = NULL; + // fallback method: write to stdout + if (level > LOG_LEVEL_WARNING || level < 0) { + FPRINTF(stdout, "%s", msg); } else { - // fallback method: write to stdout - if (level > SIMPLELOG_LEVEL_WARNING || level < 0) { - FPRINTF(stdout, "%s", outBuffer); - } else { - FPRINTF(stderr, "%s", outBuffer); - } + FPRINTF(stderr, "%s", msg); } } @@ -102,65 +65,6 @@ static void simpleLog_logv(int level, const char* fmt, va_list argp) { simpleLog_out(level, outBuffer); } -void simpleLog_init(const char* _logFileName, bool _useTimeStamps, - int _logLevel, bool append) { - - if (_logFileName != NULL) { - logFileInitialized = false; - bool initOk = true; - STRCPY_T(logFileName, logFileName_sizeMax, _logFileName); - - // make sure the dir of the log file exists - char* logFileDir = util_allocStrCpy(logFileName); - if (initOk && !util_getParentDir(logFileDir)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, - "Failed to evaluate the parent dir of the config file: %s", - logFileName); - initOk = false; - } - - if (initOk && !util_makeDir(logFileDir, true)) { - simpleLog_logL(SIMPLELOG_LEVEL_ERROR, - "Failed to create the parent dir of the config file: %s", - logFileDir); - initOk = false; - } - - free(logFileDir); - - // delete the logFile, and try writing to it - FILE* file = NULL; - if (initOk) { - if (append) { - file = FOPEN(logFileName, "a"); - } else { - file = FOPEN(logFileName, "w"); - } - } - if (file != NULL) { - // make the file empty - FPRINTF(file, "%s", ""); - fclose(file); - file = NULL; - } else { - // report the error to stderr - FPRINTF(stderr, "Failed writing to the log file \"%s\".\n%s", - logFileName, "We will continue logging to stdout."); - } - - useTimeStamps = _useTimeStamps; - logLevel = _logLevel; - logFileInitialized = initOk; - } else { - simpleLog_logL(-1, "No log file name supplied -> logging to stdout and stderr", - useTimeStamps ? "yes" : "no", logLevel); - logFileInitialized = false; - } - - simpleLog_logL(-1, "[logging started (time-stamps: %s / logLevel: %i)]", - useTimeStamps ? "yes" : "no", logLevel); -} - void simpleLog_logL(int level, const char* fmt, ...) { if (level > logLevel) { @@ -176,7 +80,7 @@ void simpleLog_logL(int level, const char* fmt, ...) { void simpleLog_log(const char* fmt, ...) { - static const int level = SIMPLELOG_LEVEL_NORMAL; + static const int level = LOG_LEVEL_INFO; if (level > logLevel) { return; @@ -189,22 +93,11 @@ void simpleLog_log(const char* fmt, ...) { va_end(argp); } -const char* simpleLog_levelToStr(int logLevel) { - - switch (logLevel) { - case SIMPLELOG_LEVEL_ERROR: - return "ERROR"; - case SIMPLELOG_LEVEL_WARNING: - return "WARNING"; - case SIMPLELOG_LEVEL_NORMAL: - return "NORMAL"; - case SIMPLELOG_LEVEL_FINE: - return "FINE"; - case SIMPLELOG_LEVEL_FINER: - return "FINER"; - case SIMPLELOG_LEVEL_FINEST: - return "FINEST"; - default: - return "CUSTOM"; - } +void simpleLog_initcallback(int id, const char* section, logfunction func, int _logLevel) +{ + strncpy(logSection, section, 32); + logFunction = func; + interfaceid = id; + logLevel = _logLevel; } + diff --git a/AI/Wrappers/CUtils/SimpleLog.h b/AI/Wrappers/CUtils/SimpleLog.h index 3bbb1fb91a2..ba0d71ee7a6 100644 --- a/AI/Wrappers/CUtils/SimpleLog.h +++ b/AI/Wrappers/CUtils/SimpleLog.h @@ -22,28 +22,12 @@ extern "C" { #endif -enum SimpleLog_Level { - SIMPLELOG_LEVEL_ERROR = 1, - SIMPLELOG_LEVEL_WARNING = 3, - SIMPLELOG_LEVEL_NORMAL = 5, - SIMPLELOG_LEVEL_FINE = 8, - SIMPLELOG_LEVEL_FINER = 9, - SIMPLELOG_LEVEL_FINEST = 10 -}; - +#include "System/Log/Level.h" #include /* bool, true, false */ -#define EXTERNAL_LOGGER(msg) log(msg); +typedef void (*logfunction)(int id, const char* section, int level, const char* msg); -/** - * Initializes the log. - * @param logFileName file to log to - * @param useTimeStamps prefix each log entry with a timestamp - * @param logLevel see enum SimpleLog_Level - * @param append if true, previous content of the file is preserved - */ -void simpleLog_init(const char* logFileName, bool useTimeStamps, - int logLevel, bool append); +void simpleLog_initcallback(int, const char* section, logfunction func, int loglevel); /** * Logs a text message, @@ -60,12 +44,6 @@ void simpleLog_logL(int level, const char* fmt, ...); */ void simpleLog_log(const char* fmt, ...); -/** - * Returns a string representation of a log level. - * @param logLevel see enum SimpleLog_Level - */ -const char* simpleLog_levelToStr(int logLevel); - #ifdef __cplusplus } // extern "C" #endif diff --git a/rts/ExternalAI/Interface/SAIInterfaceCallback.h b/rts/ExternalAI/Interface/SAIInterfaceCallback.h index e02d59669a7..76b7937120d 100644 --- a/rts/ExternalAI/Interface/SAIInterfaceCallback.h +++ b/rts/ExternalAI/Interface/SAIInterfaceCallback.h @@ -146,6 +146,9 @@ struct SAIInterfaceCallback { /// This will end up in infolog void (CALLING_CONV *Log_log)(int interfaceId, const char* const msg); + /// This will end up in infolog + void (CALLING_CONV *Log_logsl)(int interfaceId, const char* section, int loglevel, const char* const msg); + /** * Inform the engine of an error that happend in the interface. * @param msg error message diff --git a/rts/ExternalAI/SAIInterfaceCallbackImpl.cpp b/rts/ExternalAI/SAIInterfaceCallbackImpl.cpp index 94b24870684..29e5e6347e0 100644 --- a/rts/ExternalAI/SAIInterfaceCallbackImpl.cpp +++ b/rts/ExternalAI/SAIInterfaceCallbackImpl.cpp @@ -164,6 +164,16 @@ EXPORT(void) aiInterfaceCallback_Log_log(int interfaceId, const char* const msg) LOG("AI Interface <%s-%s>: %s", info->GetName().c_str(), info->GetVersion().c_str(), msg); } + +EXPORT(void) aiInterfaceCallback_Log_logsl(int interfaceId, const char* section, int loglevel, const char* const msg) { + + CHECK_INTERFACE_ID(interfaceId); + + const CAIInterfaceLibraryInfo* info = infos[interfaceId]; + log_frontend_record(section, loglevel, "%s", msg); +} + + EXPORT(void) aiInterfaceCallback_Log_exception(int interfaceId, const char* const msg, int severety, bool die) { CHECK_INTERFACE_ID(interfaceId); @@ -341,6 +351,7 @@ static void aiInterfaceCallback_init(struct SAIInterfaceCallback* callback) { callback->SkirmishAIs_getMax = &aiInterfaceCallback_SkirmishAIs_getMax; callback->SkirmishAIs_Info_getValueByKey = &aiInterfaceCallback_SkirmishAIs_Info_getValueByKey; callback->Log_log = &aiInterfaceCallback_Log_log; + callback->Log_logsl = &aiInterfaceCallback_Log_logsl; callback->Log_exception = &aiInterfaceCallback_Log_exception; callback->DataDirs_getPathSeparator = &aiInterfaceCallback_DataDirs_getPathSeparator; callback->DataDirs_getConfigDir = &aiInterfaceCallback_DataDirs_getConfigDir; diff --git a/rts/ExternalAI/SAIInterfaceCallbackImpl.h b/rts/ExternalAI/SAIInterfaceCallbackImpl.h index 1162e27388d..043d52d2423 100644 --- a/rts/ExternalAI/SAIInterfaceCallbackImpl.h +++ b/rts/ExternalAI/SAIInterfaceCallbackImpl.h @@ -36,6 +36,7 @@ EXPORT(int ) aiInterfaceCallback_SkirmishAIs_getMax(int UNUSED_inte EXPORT(const char* ) aiInterfaceCallback_SkirmishAIs_Info_getValueByKey(int UNUSED_interfaceId, const char* const shortName, const char* const version, const char* const key); EXPORT(void ) aiInterfaceCallback_Log_log(int interfaceId, const char* const msg); +EXPORT(void ) aiInterfaceCallback_Log_logsl(int interfaceId, const char* section, int loglevel, const char* const msg); EXPORT(void ) aiInterfaceCallback_Log_exception(int interfaceId, const char* const msg, int severety, bool die); EXPORT(char ) aiInterfaceCallback_DataDirs_getPathSeparator(int UNUSED_interfaceId);