SHA256
.
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <featherlog/logger.hpp>
|
||||
#include <featherlog/log_level.hpp>
|
||||
@@ -24,14 +23,15 @@ namespace flog {
|
||||
LogManager(LogManager &&) = delete;
|
||||
LogManager &operator=(LogManager &&) = delete;
|
||||
|
||||
static std::shared_ptr<LogManager> FLOG_CALL create();
|
||||
_NODISCARD static std::shared_ptr<LogManager> FLOG_CALL create();
|
||||
|
||||
~LogManager();
|
||||
~LogManager() = default;
|
||||
|
||||
LogLevel FLOG_CALL get_min_log_level() const noexcept;
|
||||
void FLOG_CALL set_min_log_level(LogLevel level) noexcept;
|
||||
|
||||
void FLOG_CALL add_outputter(std::unique_ptr<LogOutputter> outputter);
|
||||
PushResult FLOG_CALL add_outputter(const std::string& name, std::unique_ptr<LogOutputter> outputter);
|
||||
std::optional<LogOutputter> FLOG_CALL get_outputter() noexcept;
|
||||
|
||||
std::shared_ptr<Logger> FLOG_CALL get_logger(const std::string &name);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace flog {
|
||||
std::atomic<LogLevel> m_minLogLevel{LogLevel::DEBUG};
|
||||
|
||||
mutable std::shared_mutex m_logOutputtersMutex;
|
||||
std::vector<std::unique_ptr<LogOutputter>> m_logOutputters;
|
||||
std::unordered_map<std::string, std::unique_ptr<LogOutputter>> m_logOutputters;
|
||||
|
||||
mutable std::mutex m_loggersMutex;
|
||||
std::unordered_map<std::string, std::shared_ptr<Logger>> m_loggers;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef FEATHERLOG_PUSH_RESULT_HPP
|
||||
#define FEATHERLOG_PUSH_RESULT_HPP
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace flog {
|
||||
template <typename T>
|
||||
class PushResult {
|
||||
public:
|
||||
static PushResult getVoid() {
|
||||
return PushResult(3);
|
||||
}
|
||||
|
||||
private:
|
||||
explicit PushResult(std::optional<T> value) : m_value(value) {
|
||||
std::optional<T> bad;
|
||||
std::map<int, std::optional<T>> mp;
|
||||
}
|
||||
|
||||
std::optional<T> m_value;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user