Fix log instance mismatch

This commit is contained in:
dijunkun
2024-07-17 14:45:30 +08:00
parent 9702805331
commit d0cd2fe9ab
15 changed files with 32 additions and 37 deletions

View File

@@ -1,5 +1,11 @@
#ifndef _LOG_H_
#define _LOG_H_
/*
* @Author: DI JUNKUN
* @Date: 2024-07-17
* Copyright (c) 2024 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _RD_LOG_H_
#define _RD_LOG_H_
#include <chrono>
#include <iomanip>
@@ -18,18 +24,7 @@ using namespace std::chrono;
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
// SPDLOG_TRACE(...)
// SPDLOG_DEBUG(...)
// SPDLOG_INFO(...)
// SPDLOG_WARN(...)
// SPDLOG_ERROR(...)
// SPDLOG_CRITICAL(...)
#ifdef SIGNAL_LOGGER
constexpr auto LOGGER_NAME = "siganl_server";
#else
constexpr auto LOGGER_NAME = "remote_desk";
#endif
constexpr auto LOGGER_NAME = "rd";
#define LOG_INFO(...) \
if (nullptr == spdlog::get(LOGGER_NAME)) { \
@@ -124,4 +119,4 @@ constexpr auto LOGGER_NAME = "remote_desk";
SPDLOG_LOGGER_CRITICAL(spdlog::get(LOGGER_NAME), __VA_ARGS__); \
}
#endif
#endif