Обновление
This commit is contained in:
parent
c964190e8b
commit
1e41e03814
|
|
@ -11,10 +11,21 @@
|
||||||
#include "stdbool.h"
|
#include "stdbool.h"
|
||||||
|
|
||||||
#define MAX_COUNT_BUF_LOG 10
|
#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_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 {
|
typedef enum {
|
||||||
LOGLEVEL_FATAL,
|
LOGLEVEL_FATAL,
|
||||||
LOGLEVEL_ERROR,
|
LOGLEVEL_ERROR,
|
||||||
|
|
@ -38,7 +49,7 @@ typedef uint8_t * (*getMemPrintfBufLogMethod)(
|
||||||
void *env,
|
void *env,
|
||||||
const char *authorStatic,
|
const char *authorStatic,
|
||||||
const uint8_t authorLen,
|
const uint8_t authorLen,
|
||||||
uint16_t offset
|
LOG_BUF_TYPE logBufType
|
||||||
);
|
);
|
||||||
|
|
||||||
extern tStringStatic LOGGER_LEVEL_NAMES[];
|
extern tStringStatic LOGGER_LEVEL_NAMES[];
|
||||||
|
|
|
||||||
|
|
@ -756,13 +756,13 @@ 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, MAX_LEN_LOGGER_BUF_LOG);
|
char *str = (char *) logger->getMemPrintfBufLog(logger->env, authorStatic, authorLen, LOG_BUF_BIG2);
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
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);
|
va_end(args);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue