日志调整

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;
}
@ -4537,20 +4538,20 @@ int hg_scanner::image_configuration(SCANCONF& ic)
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.sharpen=%d\r\n", ic.sharpen);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.discardblank_percent=%d\r\n", ic.discardblank_percent);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.is_detachnoise=%d\r\n", ic.detachnoise.is_detachnoise);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.detachnoise=%d\r\n ", ic.detachnoise.detachnoise);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n ", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n ", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.removeMorr=%d\r\n ", ic.removeMorr);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.errorExtention=%d\r\n ", ic.errorExtention);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.textureRemove=%d\r\n ", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fillhole.is_fillhole=%d\r\n ", ic.fillhole.is_fillhole);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.detachnoise=%d\r\n", ic.detachnoise.detachnoise);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.removeMorr=%d\r\n", ic.removeMorr);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.errorExtention=%d\r\n", ic.errorExtention);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.textureRemove=%d\r\n", ic.refuseInflow);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fillhole.is_fillhole=%d\r\n", ic.fillhole.is_fillhole);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.ic.fillhole.fillholeratio=%d\r\n ", ic.fillhole.fillholeratio);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fadeback=%d\r\n ", ic.fadeback);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.enable=%d\r\n ", ic.cropRect.enable);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.width=%d\r\n ", ic.cropRect.width);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.height=%d\r\n ", ic.cropRect.height);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.x=%d\r\n ", ic.cropRect.x);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.y=%d\r\n ", ic.cropRect.y);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fadeback=%d\r\n", ic.fadeback);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.enable=%d\r\n", ic.cropRect.enable);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.width=%d\r\n", ic.cropRect.width);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.height=%d\r\n", ic.cropRect.height);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.x=%d\r\n", ic.cropRect.x);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.y=%d\r\n", ic.cropRect.y);
return ret;
}

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); \
}
@ -516,9 +529,12 @@ if (NULL != (p)) {free((p)); \
#define VLOG_2(level, bytes, fmt, arg1, arg2) \
if(hg_scanner_log_is_enable(level)) \
{ \
char* msgbuf = (char*)malloc(bytes); \
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); \
}