-
Notifications
You must be signed in to change notification settings - Fork 12
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
1 parent
1004ed3
commit aa258d3
Showing
6 changed files
with
20 additions
and
12 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 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,20 +1,23 @@ | ||
#include "logs.hpp" | ||
#include "spdlog/sinks/rotating_file_sink.h" | ||
|
||
std::shared_ptr<spdlog::logger> mining_log; | ||
std::shared_ptr<spdlog::logger> stratum_mining_log; | ||
std::shared_ptr<spdlog::logger> node_mining_log; | ||
|
||
namespace{ | ||
auto create_mining_logger() | ||
auto create_mining_logger(const std::string &logger_name, const std::string &filename) | ||
{ | ||
auto max_size = 1048576 * 5; // 5 MB | ||
auto max_files = 3; | ||
return spdlog::rotating_logger_mt("stratum_connections", "stratum_connections.log", max_size, max_files); | ||
return spdlog::rotating_logger_mt(logger_name, filename, max_size, max_files); | ||
} | ||
|
||
|
||
} | ||
void initialize_mining_log(){ | ||
mining_log = create_mining_logger();; | ||
mining_log->flush_on(spdlog::level::info); | ||
stratum_mining_log = create_mining_logger("stratum_connections", "stratum_connections.log"); | ||
stratum_mining_log->flush_on(spdlog::level::info); | ||
node_mining_log = create_mining_logger("node_mining_log", "node_mining.log"); | ||
node_mining_log->flush_on(spdlog::level::info); | ||
}; | ||
|
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