123456789101112131415161718192021222324252627282930313233343536 |
- #pragma once
- #include "triple_buffer.h"
- #include <vector>
- #include <functional>
- #include <string>
- #include <memory>
- #include "easylogging++/easylogging++.h"
- #include <thread>
- #include "msg_vector.h"
- class LogFile
- {
- public:
- LogFile();
- ~LogFile();
- LogFile(const LogFile&) = delete;
- LogFile& operator=(const LogFile&) = delete;
- bool init(const char* conf_file, const char* app_name);
- void shut();
- bool trace_log(int log_type, const char* log_content);
- private:
- void check_output();
- private:
- el::Configurations conf_;
- TTripleBuffer<MessageVector> msg_queue_;
- std::thread thread_;
- bool running_{};
- size_t shrink_size_{};
- };
|