Change signal server logfile name

This commit is contained in:
dijunkun
2023-10-11 15:06:54 +08:00
parent 24b94b8ffc
commit a25b7f0aad
4 changed files with 8 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ int main(int argc, char* argv[]) {
} else {
port = "9090";
}
std::cout << "Port: " << port << std::endl;
s.run(std::stoi(port));
return 0;
}

View File

@@ -102,6 +102,8 @@ bool SignalServer::on_pong(websocketpp::connection_hdl hdl, std::string s) {
}
void SignalServer::run(uint16_t port) {
LOG_INFO("Signal server runs on port [{}]", port);
server_.set_reuse_addr(true);
server_.listen(port);

View File

@@ -10,7 +10,7 @@ add_requires("asio 1.24.0", "nlohmann_json", "spdlog 1.11.0")
add_defines("ASIO_STANDALONE", "ASIO_HAS_STD_TYPE_TRAITS", "ASIO_HAS_STD_SHARED_PTR",
"ASIO_HAS_STD_ADDRESSOF", "ASIO_HAS_STD_ATOMIC", "ASIO_HAS_STD_CHRONO", "ASIO_HAS_CSTDINT", "ASIO_HAS_STD_ARRAY",
"ASIO_HAS_STD_SYSTEM_ERROR")
"ASIO_HAS_STD_SYSTEM_ERROR", "SIGNAL_LOGGER")
if is_os("windows") then
add_defines("_WEBSOCKETPP_CPP11_INTERNAL_")
@@ -28,8 +28,8 @@ includes("../../thirdparty")
target("log")
set_kind("headeronly")
add_packages("spdlog")
add_headerfiles("../../src/log/log.h")
add_includedirs("../../src/log", {public = true})
add_headerfiles("../utils/log/log.h")
add_includedirs("../utils/log", {public = true})
target("common")
set_kind("headeronly")

View File

@@ -26,9 +26,9 @@ using namespace std::chrono;
// SPDLOG_CRITICAL(...)
#ifdef SIGNAL_LOGGER
constexpr auto LOGGER_NAME = "siganl";
constexpr auto LOGGER_NAME = "siganl_server";
#else
constexpr auto LOGGER_NAME = "rtc";
constexpr auto LOGGER_NAME = "remote_desk";
#endif
#define LOG_INFO(...) \