diff --git a/Inc/LoggerInterface.h b/Inc/LoggerInterface.h index 7aeeca9..f2233f7 100644 --- a/Inc/LoggerInterface.h +++ b/Inc/LoggerInterface.h @@ -11,10 +11,21 @@ #include "stdbool.h" #define MAX_COUNT_BUF_LOG 10 -#define MAX_LEN_PRINTF_BUF_LOG 256 -#define MAX_LEN_LOGGER_BUF_LOG 256 #define MAX_LEN_BUF_NAME_LOG 16 +#define MAX_LEN_BUF_SMALL_LOG 32 +#define MAX_LEN_BUF_BIG1_LOG 64 +#define MAX_LEN_BUF_BIG2_LOG 192 + + + +typedef enum +{ + LOG_BUF_SMALL, + LOG_BUF_BIG1, + LOG_BUF_BIG2 +} LOG_BUF_TYPE; + typedef enum { LOGLEVEL_FATAL, LOGLEVEL_ERROR, @@ -38,7 +49,7 @@ typedef uint8_t * (*getMemPrintfBufLogMethod)( void *env, const char *authorStatic, const uint8_t authorLen, - uint16_t offset + LOG_BUF_TYPE logBufType ); extern tStringStatic LOGGER_LEVEL_NAMES[]; diff --git a/Src/LoggerPrintf.c b/Src/LoggerPrintf.c index c526953..f2e21aa 100644 --- a/Src/LoggerPrintf.c +++ b/Src/LoggerPrintf.c @@ -756,13 +756,13 @@ void LoggerPrintf( // LoggerInfo(logger, "ss", "", 0); //char str[128]; - char *str = (char *) logger->getMemPrintfBufLog(logger->env, authorStatic, authorLen, MAX_LEN_LOGGER_BUF_LOG); + char *str = (char *) logger->getMemPrintfBufLog(logger->env, authorStatic, authorLen, LOG_BUF_BIG2); int result; va_list args; va_start(args, fmt); - result = vsnprintf(str, MAX_LEN_PRINTF_BUF_LOG, fmt, args); + result = vsnprintf(str, MAX_LEN_BUF_BIG2_LOG, fmt, args); va_end(args);