SHA256
.
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
#define FEATHERLOG_LOG_FORMATTER_HPP
|
||||
|
||||
#include <string>
|
||||
#include <featherlog/flog_definitions.h>
|
||||
|
||||
namespace flog
|
||||
{
|
||||
class FLOG_API LogFormatter
|
||||
{
|
||||
namespace flog {
|
||||
class FLOG_API LogFormatter {
|
||||
public:
|
||||
virtual ~LogFormatter() = default;
|
||||
virtual FLOG_CALL std::string format() = 0;
|
||||
|
||||
virtual std::string FLOG_CALL format() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace flog
|
||||
{
|
||||
enum class LogLevel : uint8_t
|
||||
{
|
||||
namespace flog {
|
||||
using LogLevelType = uint8_t;
|
||||
enum class LogLevel : LogLevelType {
|
||||
TRACE = 0,
|
||||
DEBUG = 1,
|
||||
INFO = 2,
|
||||
@@ -14,7 +13,7 @@ namespace flog
|
||||
ERROR = 4,
|
||||
FATAL = 5,
|
||||
|
||||
OFF = 0xff,
|
||||
OFF = std::numeric_limits<LogLevelType>::max()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,35 +14,33 @@
|
||||
#include <featherlog/log_outputter.hpp>
|
||||
#include <featherlog/flog_definitions.h>
|
||||
|
||||
namespace flog
|
||||
{
|
||||
class FLOG_API LogManager : public std::enable_shared_from_this<LogManager>
|
||||
{
|
||||
namespace flog {
|
||||
class FLOG_API LogManager : public std::enable_shared_from_this<LogManager> {
|
||||
friend class LoggerCallback;
|
||||
|
||||
public:
|
||||
LogManager(const LogManager&) = delete;
|
||||
LogManager& operator=(const LogManager&) = delete;
|
||||
LogManager(LogManager&&) = delete;
|
||||
LogManager& operator=(LogManager&&) = delete;
|
||||
LogManager(const LogManager &) = delete;
|
||||
LogManager &operator=(const LogManager &) = delete;
|
||||
LogManager(LogManager &&) = delete;
|
||||
LogManager &operator=(LogManager &&) = delete;
|
||||
|
||||
static std::shared_ptr<LogManager> create();
|
||||
static std::shared_ptr<LogManager> FLOG_CALL create();
|
||||
|
||||
~LogManager();
|
||||
|
||||
LogLevel get_min_log_level() const noexcept;
|
||||
void set_min_log_level(LogLevel level) noexcept;
|
||||
LogLevel FLOG_CALL get_min_log_level() const noexcept;
|
||||
void FLOG_CALL set_min_log_level(LogLevel level) noexcept;
|
||||
|
||||
void add_outputter(std::unique_ptr<LogOutputter> outputter);
|
||||
void FLOG_CALL add_outputter(std::unique_ptr<LogOutputter> outputter);
|
||||
|
||||
std::shared_ptr<Logger> get_logger(const std::string& name);
|
||||
std::shared_ptr<Logger> FLOG_CALL get_logger(const std::string &name);
|
||||
|
||||
size_t clean_unused_loggers();
|
||||
size_t FLOG_CALL clean_unused_loggers();
|
||||
|
||||
private:
|
||||
LogManager() noexcept = default;
|
||||
|
||||
void print_log(const LogMessage& message) const;
|
||||
void FLOG_CALL print_log(const LogMessage &message) const;
|
||||
|
||||
std::atomic<LogLevel> m_minLogLevel{LogLevel::DEBUG};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user