Обновление

This commit is contained in:
cfif 2026-03-11 11:08:21 +03:00
parent ffe5291609
commit 019b6bce12
2 changed files with 14 additions and 2 deletions

View File

@ -10,6 +10,10 @@
#include "stdint.h" #include "stdint.h"
#include "stdbool.h" #include "stdbool.h"
#define MAX_COUNT_BUF_LOG 10
#define MAX_LEN_BUF_LOG 128
#define MAX_LEN_BUF_NAME_LOG 16
typedef enum { typedef enum {
LOGLEVEL_FATAL, LOGLEVEL_FATAL,
LOGLEVEL_ERROR, LOGLEVEL_ERROR,
@ -29,11 +33,18 @@ typedef void (*LoggerGenericMethod)(
bool complete bool complete
); );
typedef uint8_t * (*getMemPrintfBufLogMethod)(
void *env,
const char *authorStatic,
const uint8_t authorLen
);
extern tStringStatic LOGGER_LEVEL_NAMES[]; extern tStringStatic LOGGER_LEVEL_NAMES[];
typedef struct { typedef struct {
void *env; void *env;
LoggerGenericMethod logging; LoggerGenericMethod logging;
getMemPrintfBufLogMethod getMemPrintfBufLog;
} tLoggerInterface; } tLoggerInterface;

View File

@ -755,13 +755,14 @@ void LoggerPrintf(
// //
// LoggerInfo(logger, "ss", "", 0); // LoggerInfo(logger, "ss", "", 0);
char str[128]; //char str[128];
char *str = (char *) logger->getMemPrintfBufLog(logger->env, authorStatic, authorLen);
int result; int result;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
result = vsnprintf(str, sizeof(str), fmt, args); result = vsnprintf(str, MAX_LEN_BUF_LOG, fmt, args);
va_end(args); va_end(args);