Files
FeatherLog/include/featherlog/logger.hpp
T
2026-08-19 09:00:28 +08:00

38 lines
930 B
C++

#pragma once
#include <format>
#include <source_location>
#include <utility>
#include <featherlog/flog_definitions.h>
namespace flog
{
class LogManager;
class FLOG_API Logger final
{
friend class LogManager;
public:
Logger(const Logger&) = delete;
Logger operator=(const Logger&) = delete;
Logger(const Logger&&) = delete;
Logger operator=(const Logger&&) = delete;
~Logger() = default;
template<typename... Args>
void FLOG_CALL info(std::format_string<Args...> fmt, Args &&... args,
std::source_location loc = std::source_location::current());
private:
Logger(std::string name, const std::weak_ptr<LogManager> &manager) noexcept : m_name(std::move(name)),
m_logManager(manager)
{ }
const std::string m_name;
const std::weak_ptr<LogManager> m_logManager;
};
}