SHA256
modify something
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
#define FEATHERLOG_FEATHERLOG_HPP
|
||||
|
||||
#include <featherlog/flog_definitions.h>
|
||||
#include <featherlog/logger.hpp>
|
||||
#include <featherlog/log_formatter.hpp>
|
||||
#include <featherlog/log_level.hpp>
|
||||
#include <featherlog/log_manager.hpp>
|
||||
#include <featherlog/log_message.hpp>
|
||||
#include <featherlog/log_message_flag.hpp>
|
||||
#include <featherlog/log_outputter.hpp>
|
||||
#include <featherlog/logger.hpp>
|
||||
#include <featherlog/push_result.hpp>
|
||||
|
||||
#include <featherlog/impl/flog_impl.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,4 +27,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _NODISCARD
|
||||
#define _NODISCARD [[nodiscard]]
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef FLOG_IMPL_CONSOLE_OUTPUTTER
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef FEATHERLOG_IMPL_FLOG_IMPL_HPP
|
||||
#define FEATHERLOG_IMPL_FLOG_IMPL_HPP
|
||||
|
||||
#include <featherlog/impl/console_outputter.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOG_FORMATTER_HPP
|
||||
#define FEATHERLOG_LOG_FORMATTER_HPP
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <featherlog/flog_definitions.h>
|
||||
@@ -11,8 +10,6 @@ namespace flog
|
||||
public:
|
||||
virtual ~LogFormatter() = default;
|
||||
|
||||
virtual std::string FLOG_CALL format() = 0;
|
||||
_NODISCARD virtual std::string FLOG_CALL format(const LogMessage& message) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOG_LEVEL_HPP
|
||||
#define FEATHERLOG_LOG_LEVEL_HPP
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -18,5 +17,3 @@ namespace flog
|
||||
OFF = std::numeric_limits<LogLevelType>::max()
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOG_MANAGER_HPP
|
||||
#define FEATHERLOG_LOG_MANAGER_HPP
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
@@ -28,14 +27,16 @@ namespace flog
|
||||
|
||||
~LogManager();
|
||||
|
||||
LogLevel FLOG_CALL get_min_log_level() const noexcept;
|
||||
void FLOG_CALL set_min_log_level(LogLevel level) noexcept;
|
||||
_NODISCARD LogLevel FLOG_CALL get_min_log_level() const noexcept;
|
||||
void FLOG_CALL set_min_log_level(LogLevel level) noexcept;
|
||||
|
||||
PushResult<std::unique_ptr<LogOutputter>> FLOG_CALL add_outputter(std::unique_ptr<LogOutputter> outputter);
|
||||
bool FLOG_CALL contains_outputter(std::string_view name) const noexcept;
|
||||
std::optional<std::unique_ptr<LogOutputter>> FLOG_CALL try_delete_outputter(std::string_view name) noexcept;
|
||||
_NODISCARD PushResult<std::unique_ptr<LogOutputter>> FLOG_CALL add_outputter(
|
||||
std::unique_ptr<LogOutputter> outputter);
|
||||
|
||||
std::shared_ptr<Logger> FLOG_CALL get_logger(const std::string &name);
|
||||
_NODISCARD bool FLOG_CALL contains_outputter(std::string_view name) const;
|
||||
std::optional<std::unique_ptr<LogOutputter>> FLOG_CALL try_delete_outputter(std::string_view name);
|
||||
|
||||
_NODISCARD std::shared_ptr<Logger> FLOG_CALL get_logger(const std::string &name);
|
||||
|
||||
size_t FLOG_CALL clean_unused_loggers();
|
||||
|
||||
@@ -53,5 +54,3 @@ namespace flog
|
||||
std::unordered_map<std::string, std::shared_ptr<Logger>> m_loggers;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOG_MESSAGE_HPP
|
||||
#define FEATHERLOG_LOG_MESSAGE_HPP
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <string_view>
|
||||
@@ -19,5 +17,3 @@ namespace flog
|
||||
MessageFlag flag;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FEATHERLOG_LOG_MESSAGE_FLAG_HPP
|
||||
#define FEATHERLOG_LOG_MESSAGE_FLAG_HPP
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <limits>
|
||||
|
||||
namespace flog
|
||||
{
|
||||
@@ -21,12 +21,11 @@ namespace flog
|
||||
_NODISCARD bool isFull() const noexcept { return flagCount >= std::numeric_limits<MessageFlag>::digits; }
|
||||
_NODISCARD bool pushable() const noexcept { return !isFull(); }
|
||||
_NODISCARD bool isEmpty() const noexcept { return flagCount == 0; }
|
||||
// _NODISCARD
|
||||
|
||||
_NODISCARD bool contains(std::string_view name) const noexcept;
|
||||
|
||||
private:
|
||||
std::array<std::string, std::numeric_limits<MessageFlag>::digits> m_flagMap{};
|
||||
size_t flagCount { 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOG_OUTPUTTER_HPP
|
||||
#define FEATHERLOG_LOG_OUTPUTTER_HPP
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -11,7 +10,8 @@ namespace flog {
|
||||
class FLOG_API LogOutputter {
|
||||
public:
|
||||
explicit LogOutputter(std::string name, std::unique_ptr<LogFormatter> formatter) noexcept
|
||||
: m_name(std::move(name)), m_logFormatter(std::move(formatter)) {}
|
||||
: m_name(std::move(name)), m_logFormatter(std::move(formatter))
|
||||
{ }
|
||||
|
||||
virtual ~LogOutputter() = default;
|
||||
|
||||
@@ -28,5 +28,3 @@ namespace flog {
|
||||
std::unique_ptr<LogFormatter> m_logFormatter;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_LOGGER_HPP
|
||||
#define FEATHERLOG_LOGGER_HPP
|
||||
#pragma once
|
||||
|
||||
#include <format>
|
||||
#include <source_location>
|
||||
@@ -31,5 +30,3 @@ namespace flog
|
||||
const std::weak_ptr<LogManager> m_logManager;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FEATHERLOG_PUSH_RESULT_HPP
|
||||
#define FEATHERLOG_PUSH_RESULT_HPP
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <functional>
|
||||
@@ -37,5 +36,3 @@ namespace flog
|
||||
const std::optional<T> m_value = std::nullopt;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user