pdxcodemonkey commented on a change in pull request #761:
URL: https://github.com/apache/geode-native/pull/761#discussion_r631882082



##########
File path: cppcache/src/Log.cpp
##########
@@ -14,70 +14,41 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #include "util/Log.hpp"
 
-#include <algorithm>
-#include <cctype>
-#include <chrono>
+#include <cstdarg>
 #include <cstdio>
-#include <ctime>
-#include <map>
-#include <mutex>
-#include <regex>
 #include <sstream>
 #include <string>
-#include <thread>
-#include <utility>
 
 #include <boost/asio/ip/host_name.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/process/environment.hpp>
 
 #include <geode/ExceptionTypes.hpp>
 #include <geode/util/LogLevel.hpp>
 
 #include "geodeBanner.hpp"
+#include "spdlog/sinks/rotating_file_sink.h"
+#include "spdlog/sinks/stdout_color_sinks.h"
+#include "spdlog/spdlog.h"
 #include "util/chrono/time_point.hpp"
 
-namespace {
-
-static size_t g_bytesWritten = 0;
-
-static size_t g_fileSizeLimit = GEODE_MAX_LOG_FILE_LIMIT;
-static size_t g_diskSpaceLimit = GEODE_MAX_LOG_DISK_LIMIT;
-
-static std::mutex g_logMutex;
-
-static int g_rollIndex = 0;
-static size_t g_spaceUsed = 0;
-
-static boost::filesystem::path g_fullpath;
-static std::map<int32_t, boost::filesystem::path> g_rollFiles;
-
-static FILE* g_log = nullptr;
-
-static std::string g_hostName;
-
-const int __1K__ = 1024;
-const int __1M__ = (__1K__ * __1K__);
-
-}  // namespace
-
 namespace apache {
 namespace geode {
 namespace client {
 
-LogLevel Log::s_logLevel = LogLevel::Default;
-
-/*****************************************************************************/
+const int __1K__ = 1024;
+const int __1M__ = __1K__ * __1K__;
+const int __1G__ = __1K__ * __1M__;
+const int LOG_SCRATCH_BUFFER_SIZE = 16 * __1K__;
 
-LogLevel Log::logLevel() { return s_logLevel; }
+static std::recursive_mutex g_logMutex;

Review comment:
       I was able to eliminate most of these, but several are still needed due 
to the original implementation of our logging.  To wit, we need a mutex, the 
shared pointer to the logger, the current level, and a global singleton to 
initialize the logger at startup.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to