Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

update CMakeLists.txt and fix some issues #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(ohmyarch_bot VERSION 0.1.0 LANGUAGES CXX)

set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
Expand Down
12 changes: 6 additions & 6 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) {
nlohmann::json json;

try {
json << config_file;
config_file >> json;

ohmyarch::api_uri =
"https://api.telegram.org/bot" +
Expand All @@ -221,11 +221,11 @@ int main(int argc, char *argv[]) {
spdlog::set_async_mode(8192);

try {
std::vector<spdlog::sink_ptr> sinks{
std::make_shared<spdlog::sinks::ansicolor_sink>(
std::make_shared<spdlog::sinks::stdout_sink_mt>()),
std::make_shared<spdlog::sinks::rotating_file_sink_mt>(
json.at("log_path"), "txt", 1024 * 1024 * 5, 0)};
std::vector<spdlog::sink_ptr> sinks
{
std::make_shared<spdlog::sinks::ansicolor_stdout_sink_mt>(),
std::make_shared<spdlog::sinks::rotating_file_sink_mt>(json.at("log_path"), 1024 * 1024 * 5, 0)
};
auto combined_logger = std::make_shared<spdlog::logger>(
"logger", sinks.begin(), sinks.end());
combined_logger->flush_on(spdlog::level::err);
Expand Down