Ver código fonte

!2 Dbg打印日志时如果超过1024长度会被抛弃。
(1)由于Bug原因导致被抛弃,因为附加了Debug {},导致过长。
(2)现只打印前1024长度。最长打印为1050

80374463 6 anos atrás
pai
commit
84c948ffc0
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      libtoolkit/log.c

+ 2 - 2
libtoolkit/log.c

@@ -337,8 +337,8 @@ TOOLKIT_API int xlog_log_v(const char *inst, int level, const char *fmt, va_list
 	if (level < log->level)
 		return 0;
 
-	n = _vscprintf(fmt, arg);
-	if (n >= 0 && n < 1024) {
+	n = _vscprintf(fmt, arg);//因为添加了Debug {}, 所以可能超过了1024长度
+	if (n >= 0 && n < 1050) {
 		FILETIME ft;
 		SYSTEMTIME st;
 		char *buf = _alloca(n+1);