Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Code/client/TiltedOnlineApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ TiltedOnlineApp::TiltedOnlineApp()
auto rotatingLogger = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(logPath / "tp_client.log", 1048576 * 5, 3);
// rotatingLogger->set_level(spdlog::level::debug);
auto console = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
console->set_pattern("%^[%H:%M:%S.%e] [%l] [tid %t] %$ %v");

auto logger = std::make_shared<spdlog::logger>("", spdlog::sinks_init_list{console, rotatingLogger});
logger->set_pattern("%^[%Y-%m-%d %H:%M:%S.%e] [%l] [tid %t] %$ %v");
spdlog::flush_every(std::chrono::seconds(1));
set_default_logger(logger);
}

Expand Down
4 changes: 3 additions & 1 deletion Code/server_runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ struct LogInstance

auto fileOut = std::make_shared<sinks::rotating_file_sink_mt>(std::string("logs/") + kLogFileName, kLogFileSizeCap, 3);
auto serverOut = std::make_shared<sinks::stdout_color_sink_mt>();
serverOut->set_pattern("%^[%H:%M:%S.%e] [%l] [tid %t] %$ %v");
auto globalOut = std::make_shared<logger>("", sinks_init_list{serverOut, fileOut});
globalOut->set_pattern("%^[%Y-%m-%d %H:%M:%S.%e] [%l] [tid %t] %$ %v");

globalOut->set_level(level::from_str(sLogLevel.value()));
spdlog::flush_every(std::chrono::seconds(2));

// as the library is compiled into the client + server we have to do this twice
spdlog::set_default_logger(globalOut);
Expand Down
Loading