From 5c912c70e9333298ff48f7ea15424f72ca977b99 Mon Sep 17 00:00:00 2001
From: Fu Juntang <StrongTiger_001@163.com>
Date: 星期五, 17 九月 2021 09:43:55 +0800
Subject: [PATCH] Add the heartbeat logic feature.

---
 src/logger_factory.cpp |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/logger_factory.cpp b/src/logger_factory.cpp
index 9d445fe..79383d7 100644
--- a/src/logger_factory.cpp
+++ b/src/logger_factory.cpp
@@ -1,4 +1,5 @@
 #include "logger_factory.h"
+#include "bus_error.h"
 
 Logger * LoggerFactory::logger = NULL;
 
@@ -9,14 +10,22 @@
 		return logger;
 	 
 	LoggerConfig config;
+	config.level = Logger::ERROR;
+
+	const char *logFileFormat= "/tmp/bhome_bus.%ld.log";
+	char logFile[128];
+	sprintf(logFile, logFileFormat, getpid());
+	config.logFile = logFile;
 
 #ifdef BUILD_Debug
 	config.level = Logger::DEBUG;
-#else
-	config.level = Logger::INFO;
-#endif
-	config.logFile =  "bhome_bus.log";
 	config.console = 1;
+#else
+	config.level = Logger::ERROR;
+	config.console = 1;
+#endif
 	logger = new Logger(config);
 	return logger;
-}
\ No newline at end of file
+}
+
+ 
\ No newline at end of file

--
Gitblit v1.8.0