Logger api

Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2025-10-19 23:00:07 +03:00
1 parent 40b1f4609f
commit 053d1b7168
12 files changed
+286 -15

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <Logging/Logger.hpp>
#include <cstdint>
#include <memory>
#include <string>
#include <string_view>
namespace vl::logging {
struct Provider {
virtual ~Provider() = default;
// P3: get-or-create
virtual std::shared_ptr<Logger> createConsole(std::string prefix, Level lvl) = 0;
virtual std::shared_ptr<Logger> createFile(std::string prefix, std::string basePath,
std::uintmax_t maxBytes, Level lvl) = 0;
virtual std::shared_ptr<Logger> createCombined(std::string prefix, std::string basePath,
std::uintmax_t maxBytes, Level lvl) = 0;
virtual std::shared_ptr<Logger> get(std::string_view prefix) const = 0; // throws if absent
virtual bool exists(std::string_view prefix) const = 0;
};
} // namespace vl::log