From 387fe1dbfffdc3d73cf46f2c054f4d25543c8523 Mon Sep 17 00:00:00 2001
From: Fu Juntang <StrongTiger_001@163.com>
Date: 星期三, 01 九月 2021 10:55:35 +0800
Subject: [PATCH] Fix the building issue when protobuf is enabled.
---
include/usgcommon/logger.h | 27 +--------------------------
1 files changed, 1 insertions(+), 26 deletions(-)
diff --git a/include/usgcommon/logger.h b/include/usgcommon/logger.h
index 61d6e02..ccf17cd 100644
--- a/include/usgcommon/logger.h
+++ b/include/usgcommon/logger.h
@@ -16,32 +16,7 @@
LoggerConfig config;
FILE *logFile;
- void dolog(const char *fmt, va_list ap, int level, int err = 0) {
- char buf[MAXLINE];
-
- struct timeval tv;
- struct tm *info;
- gettimeofday(&tv, NULL);
- info = localtime(&tv.tv_sec);
- strftime(buf, MAXBUF - 1, "%Y-%d-%m %H:%M:%S", info);
- snprintf(buf + strlen(buf), MAXBUF - strlen(buf) - 1, ",%ld [%s] ", tv.tv_usec, strlevel(level));
- vsnprintf(buf + strlen(buf), MAXBUF - strlen(buf) - 1, fmt, ap);
-
- if (err != 0) {
- snprintf(buf + strlen(buf), MAXBUF - strlen(buf) - 1, ": %s", strerror(err));
- }
- strcat(buf, "\n");
- fflush(stdout); /* in case stdout and stderr are the same */
-
- if(logFile != NULL) {
- fputs(buf, logFile);
- }
- if(config.console) {
- fputs(buf, stdout);
- }
-
- fflush(NULL); /* flushes all stdio output streams */
- }
+ void dolog(const char *fmt, va_list ap, int level, int err = 0);
void init();
--
Gitblit v1.8.0