日志调整

This commit is contained in:
13038267101 2023-05-05 18:33:21 +08:00
parent cb3eb97f7f
commit 36c01e2943
3 changed files with 52 additions and 23 deletions

View File

@ -1160,6 +1160,7 @@ void hg_scanner::working_done(void*)
{
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "[%s] EXIT All Thread--->Total picture: [%d] and scanner status [%s].\n", hg_log::current_time().c_str(), final_img_index_, hg_scanner_err_description(status_));
}
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "----------Main End scan status----------%s:\n", hg_scanner_err_description(status_));
test_1_paper_ = false;
}

View File

@ -444,7 +444,7 @@ extern "C"
if (t)
*t = *l;
if (tmbuf)
sprintf(tmbuf, "%04d-%02d-%02d %02d:%02d:%02d", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec);
sprintf(tmbuf, "%04d-%02d-%02d %02d:%02d:%02d--->", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec);
}
void hg_get_current_time_w(wchar_t* tmbuf, struct tm* t)
{
@ -454,7 +454,7 @@ extern "C"
if (t)
*t = *l;
if (tmbuf)
swprintf(tmbuf, 40, L"%04d-%02d-%02d %02d:%02d:%02d", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec);
swprintf(tmbuf, 40, L"%04d-%02d-%02d %02d:%02d:%02d--->", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec);
}
}

View File

@ -500,14 +500,27 @@ if (NULL != (p)) {free((p)); \
#define LOG_INFO(level, info) \
if(hg_scanner_log_is_enable(level)) \
hg_scanner_log(info);
{\
char* msgbuf = (char*)malloc(VLOG_MINI_BYTES); \
if (msgbuf != NULL) \
{ \
hg_get_current_time(msgbuf);\
strcpy(msgbuf+strlen(msgbuf),info); \
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
} \
} \
#define VLOG_1(level, bytes, fmt, arg1) \
if(hg_scanner_log_is_enable(level)) \
{ \
char* msgbuf = (char*)malloc(bytes); \
if (msgbuf != NULL) \
sprintf(msgbuf, fmt, arg1); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf +strlen(msgbuf), fmt, arg1); \
} \
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}
@ -518,7 +531,10 @@ if (NULL != (p)) {free((p)); \
{ \
char* msgbuf = (char*)malloc(bytes); \
if (msgbuf != NULL) \
sprintf(msgbuf, fmt, arg1, arg2); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2); \
} \
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}
@ -529,7 +545,10 @@ if (NULL != (p)) {free((p)); \
{ \
char* msgbuf = (char*)malloc(bytes); \
if (msgbuf != NULL) \
sprintf(msgbuf, fmt, arg1, arg2, arg3); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf +strlen(msgbuf), fmt, arg1, arg2, arg3); \
}\
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}
@ -540,7 +559,10 @@ if (NULL != (p)) {free((p)); \
{ \
char* msgbuf = (char*)malloc(bytes); \
if (msgbuf != NULL) \
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4); \
}\
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}
@ -552,7 +574,10 @@ if (NULL != (p)) {free((p)); \
{ \
char* msgbuf = (char*)malloc(bytes); \
if(msgbuf) \
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4, arg5); \
}\
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}
@ -564,7 +589,10 @@ if (NULL != (p)) {free((p)); \
{ \
char* msgbuf = (char*)malloc(bytes); \
if (msgbuf != NULL) \
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
{ \
hg_get_current_time(msgbuf);\
sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
}\
hg_scanner_log(msgbuf); \
SAFE_FREE(msgbuf); \
}