OPCUA: cosmetic fixes wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 05 Oct 2022 20:44:01 +0200
branchwxPython4
changeset 3620 1cf21430ed4a
parent 3619 f75b11506fb2
child 3630 921f620577e8
OPCUA: cosmetic fixes
opc_ua/opcua_client_maker.py
--- a/opc_ua/opcua_client_maker.py	Wed Oct 05 20:25:58 2022 +0200
+++ b/opc_ua/opcua_client_maker.py	Wed Oct 05 20:44:01 2022 +0200
@@ -564,7 +564,7 @@
 #define LogWarning(...) _Log(LOG_WARNING, __VA_ARGS__);
 
 #define INIT_NoAuth()                                                                              \\
-    LogInfo("OPC-UA Init no auth\\n");                                                             \\
+    LogInfo("OPC-UA Init no auth");                                                                \\
     UA_ClientConfig_setDefault(cc);                                                                \\
     retval = UA_Client_connect(client, uri);
 
@@ -574,7 +574,7 @@
     UA_ByteString certificate = loadFile(Certificate);                                             \\
     UA_ByteString privateKey  = loadFile(PrivateKey);                                              \\
                                                                                                    \\
-    LogInfo("OPC-UA Init x509 %s,%s,%s,%s\\n", #Policy, #UpperCaseMode, PrivateKey, Certificate);  \\
+    LogInfo("OPC-UA Init x509 %s,%s,%s,%s", #Policy, #UpperCaseMode, PrivateKey, Certificate);     \\
     cc->securityMode = UA_MESSAGESECURITYMODE_##UpperCaseMode;                                     \\
     UA_ClientConfig_setDefaultEncryption(cc, certificate, privateKey, NULL, 0, NULL, 0);           \\
                                                                                                    \\
@@ -584,7 +584,7 @@
     UA_ByteString_clear(&privateKey);
 
 #define INIT_UserPassword(User, Password)                                                          \\
-    LogInfo("OPC-UA Init UserPassword %s,%s\\n", User, Password);                                  \\
+    LogInfo("OPC-UA Init UserPassword %s,%s", User, Password);                                     \\
     UA_ClientConfig_setDefault(cc);                                                                \\
     retval = UA_Client_connectUsername(client, uri, User, Password);
 
@@ -603,7 +603,7 @@
 {init}
 
     if(retval != UA_STATUSCODE_GOOD) {{
-        LogError("OPC-UA Init Failed %d\\n", retval);                                              \\
+        LogError("OPC-UA Init Failed %d", retval);
         UA_Client_delete(client);
         return EXIT_FAILURE;
     }}
@@ -741,7 +741,7 @@
 """%(path, path[:-2]) + modeldata.GenerateC(path, "test", config) + """
 
 int LogMessage(uint8_t level, char* buf, uint32_t size){
-    printf("log level:%d message:'%.*s'", level, size, buf);
+    printf("log level:%d message:'%.*s'\\n", level, size, buf);
 };
 
 int main(int argc, char *argv[]) {