Skip to content

Commit

Permalink
refactor(tools): Use UA_String_printf in the ua-cli tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Nov 6, 2024
1 parent 173c670 commit b22a488
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/ua-cli/ua.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <open62541/plugin/log.h>
#include <open62541/client.h>
#include <open62541/client_config_default.h>
#include "../../deps/mp_printf.h"

#include <stdio.h>
#include <ctype.h>
Expand Down Expand Up @@ -63,10 +62,11 @@ cliLog(void *context, UA_LogLevel level, UA_LogCategory category,

/* Log */
#define LOGBUFSIZE 512
char logbuf[LOGBUFSIZE];
UA_Byte logbuf[LOGBUFSIZE];
UA_String out = {LOGBUFSIZE, logbuf};
UA_String_vprintf(&out, msg, args);
fprintf(stderr, "%s/%s" ANSI_COLOR_RESET "\t",
logLevelNames[logLevelSlot], logCategoryNames[category]);
mp_vsnprintf(logbuf, LOGBUFSIZE, msg, args);
fprintf(stderr, "%s\n", logbuf);
fflush(stderr);
}
Expand Down

0 comments on commit b22a488

Please sign in to comment.