-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
72 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
bin/Debug/config.toml → ...ows/WFP/service/domain_block_service.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
#include "service.hpp" | ||
|
||
int main(int argc, char* argv[]) { | ||
boost::filesystem::path cur_path = boost::dll::program_location().parent_path(); | ||
boost::filesystem::path cfg_path = cur_path / "config.toml"; | ||
std::cout << cfg_path.string() << std::endl; | ||
// 解析配置文件 | ||
config::instance().parse_toml(cfg_path); | ||
int main(int argc, char *argv[]) { | ||
boost::filesystem::path cur_path = | ||
boost::dll::program_location().parent_path(); | ||
boost::filesystem::path cfg_path = cur_path / "domain_block_service.toml"; | ||
std::cout << cfg_path.string() << std::endl; | ||
// 解析配置文件 | ||
config::instance().parse_toml(cfg_path); | ||
|
||
// 初始化日志配置 | ||
std::string log_file_path = config::instance().get_str("log_file_path"); | ||
std::string log_level = config::instance().get_str("log_level"); | ||
int max_log_files = config::instance().get_int("max_log_files"); | ||
int max_log_file_size = config::instance().get_int("max_log_file_size"); | ||
Log::SPDLOG::getInstance().init(log_file_path, "default_logger", log_level, | ||
max_log_file_size * 1024 * 1024, max_log_files, false); | ||
LOG_DEBUG("log has inited."); | ||
service::start(); | ||
LOG_DEBUG("process end."); | ||
return 0; | ||
// 初始化日志配置 | ||
std::string log_file_path = config::instance().get_str("log_file_path"); | ||
std::string log_level = config::instance().get_str("log_level"); | ||
int max_log_files = config::instance().get_int("max_log_files"); | ||
int max_log_file_size = config::instance().get_int("max_log_file_size"); | ||
Log::SPDLOG::getInstance().init(log_file_path, "default_logger", log_level, | ||
max_log_file_size * 1024 * 1024, | ||
max_log_files, false); | ||
LOG_DEBUG("log has inited."); | ||
service::start(); | ||
LOG_DEBUG("process end."); | ||
return 0; | ||
} |