|
- #pragma once
-
- #include <chrono>
- #include <thread>
- #include <memory>
-
- namespace cpplogging
- {
-
- /**
- * @brief Log level.
- */
- enum class log_level
- {
- unknown = 0,
- debug,
- info,
- warn,
- error,
- };
-
- /**
- * @brief Log entry that stored all relevant information for a logged message.
- */
- struct log_entry
- {
- using clock_type = std::chrono::steady_clock;
- using uptime_type = clock_type::time_point;
-
- log_level level { log_level::debug };
- uptime_type uptime { clock_type::now() };
- time_t systime { std::time(nullptr) };
- const void* sender { nullptr };
- std::string sender_type { "void" };
- std::thread::id thread { std::this_thread::get_id() };
- const char* file { nullptr };
- int line { 0 };
- std::string name;
- std::string message;
- };
-
- using log_entry_ptr_s = std::shared_ptr<log_entry>;
-
- }
|