logging changes
This commit is contained in:
@ -29,24 +29,27 @@ class logging_consumer {
|
||||
E_CONSUMER();
|
||||
|
||||
public:
|
||||
logging_consumer(const std::string &log_directory, const event_level &level);
|
||||
logging_consumer(event_level level, std::string log_directory);
|
||||
|
||||
~logging_consumer();
|
||||
|
||||
private:
|
||||
const std::uint8_t MAX_LOG_FILES = 5;
|
||||
const std::uint64_t MAX_LOG_FILE_SIZE = (1024 * 1024 * 5);
|
||||
static constexpr const std::uint8_t MAX_LOG_FILES{5U};
|
||||
static constexpr const std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL *
|
||||
5ULL};
|
||||
|
||||
private:
|
||||
event_level event_level_ = event_level::normal;
|
||||
const std::string log_directory_;
|
||||
const std::string log_path_;
|
||||
bool logging_active_ = true;
|
||||
event_level event_level_;
|
||||
std::string log_directory_;
|
||||
std::string log_path_;
|
||||
|
||||
private:
|
||||
std::deque<std::shared_ptr<event>> event_queue_;
|
||||
FILE *log_file_{nullptr};
|
||||
std::mutex log_mutex_;
|
||||
std::condition_variable log_notify_;
|
||||
std::deque<std::shared_ptr<event>> event_queue_;
|
||||
bool logging_active_{true};
|
||||
std::unique_ptr<std::thread> logging_thread_;
|
||||
FILE *log_file_ = nullptr;
|
||||
|
||||
private:
|
||||
void check_log_roll(std::size_t count);
|
||||
|
Reference in New Issue
Block a user