From 08505499d1449f53449e119aefc71324376b348b Mon Sep 17 00:00:00 2001
From: shenxin <shenxin@basic.com>
Date: 星期一, 23 八月 2021 19:40:14 +0800
Subject: [PATCH] 增加BHSubscribeNetTopics、BHQueryTopicAddress接口 修改CMakeLists.txt,增加相应文件到编译中。(需要安装protobuf)
---
include/usgcommon/logger.h | 29 ++---------------------------
1 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/include/usgcommon/logger.h b/include/usgcommon/logger.h
index cf0d2ba..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();
@@ -66,7 +41,7 @@
void error(const char *fmt, ...);
void error(int err, const char *fmt, ...);
void fatal(const char *fmt, ...);
-
+ void fatal(int err, const char *fmt, ...) ;
static const char * strlevel(int level);
};
--
Gitblit v1.8.0