<commit_before>#pragma once

#include <samplog/PluginLogger.hpp>
#include "CSingleton.hpp"
#include "CError.hpp"

#include <format.h>
#include <atomic>

using samplog::PluginLogger_t;
using samplog::LOGLEVEL;


class CLog : public CSingleton<CLog>
{
	friend class CSingleton<CLog>;
private:
	CLog();
	~CLog() = default;

public:
	template<typename... Args>
	void Log(const LOGLEVEL &level, const std::string &fmt, Args &&...args)
	{
		m_Logger.load(std::memory_order_acquire)
			->Log(level, fmt::format(fmt, std::forward<Args>(args)...));
	}
	template<typename... Args>
	void Log(AMX * const amx, const LOGLEVEL &level, const std::string &fmt, Args &&...args)
	{
		m_Logger.load(std::memory_order_acquire)
			->Log(amx, level, fmt::format(fmt, std::forward<Args>(args)...));
	}
	
	inline bool LogNativeCall(AMX * const amx, const std::string &name, const std::string &params_format)
	{
		return m_Logger.load(std::memory_order_acquire)
			->LogNativeCall(amx, name, params_format);
	}

	template<typename T>
	inline void LogError(AMX * const amx, const std::string &func, const CError<T> &error)
	{
		Log(amx, LOGLEVEL::ERROR, "{}: {} error: {}",
			func.c_str(), error.module().c_str(), error.msg().c_str());
	}
	inline void LogError(AMX * const amx, const std::string &func, const std::string &msg)
	{
		Log(amx, LOGLEVEL::ERROR, "{}: {}", func.c_str(), msg.c_str());
	}
	template<typename... Args>
	inline void LogError(AMX * const amx, const std::string &func, 
		const std::string &format, Args &&...args)
	{
		LogError(amx, func, fmt::format(format, std::forward<Args>(args)...));
	}

	inline void LogWarning(AMX * const amx, const std::string &func, const std::string &msg)
	{
		Log(amx, LOGLEVEL::WARNING, "{}: {}", func.c_str(), msg.c_str());
	}
	template<typename... Args>
	inline void LogError(AMX * const amx, const std::string &func,
		const std::string &format, Args &&...args)
	{
		LogError(amx, func, fmt::format(format, std::forward<Args>(args)...));
	}

private:
	std::atomic<PluginLogger_t> m_Logger;
};<commit_msg>fix small mistake<commit_after>#pragma once

#include <samplog/PluginLogger.hpp>
#include "CSingleton.hpp"
#include "CError.hpp"

#include <format.h>
#include <atomic>

using samplog::PluginLogger_t;
using samplog::LOGLEVEL;


class CLog : public CSingleton<CLog>
{
	friend class CSingleton<CLog>;
private:
	CLog();
	~CLog() = default;

public:
	template<typename... Args>
	void Log(const LOGLEVEL &level, const std::string &fmt, Args &&...args)
	{
		m_Logger.load(std::memory_order_acquire)
			->Log(level, fmt::format(fmt, std::forward<Args>(args)...));
	}
	template<typename... Args>
	void Log(AMX * const amx, const LOGLEVEL &level, const std::string &fmt, Args &&...args)
	{
		m_Logger.load(std::memory_order_acquire)
			->Log(amx, level, fmt::format(fmt, std::forward<Args>(args)...));
	}
	
	inline bool LogNativeCall(AMX * const amx, const std::string &name, const std::string &params_format)
	{
		return m_Logger.load(std::memory_order_acquire)
			->LogNativeCall(amx, name, params_format);
	}

	template<typename T>
	inline void LogError(AMX * const amx, const std::string &func, const CError<T> &error)
	{
		Log(amx, LOGLEVEL::ERROR, "{}: {} error: {}",
			func.c_str(), error.module().c_str(), error.msg().c_str());
	}
	inline void LogError(AMX * const amx, const std::string &func, const std::string &msg)
	{
		Log(amx, LOGLEVEL::ERROR, "{}: {}", func.c_str(), msg.c_str());
	}
	template<typename... Args>
	inline void LogError(AMX * const amx, const std::string &func, 
		const std::string &format, Args &&...args)
	{
		LogError(amx, func, fmt::format(format, std::forward<Args>(args)...));
	}

	inline void LogWarning(AMX * const amx, const std::string &func, const std::string &msg)
	{
		Log(amx, LOGLEVEL::WARNING, "{}: {}", func.c_str(), msg.c_str());
	}
	template<typename... Args>
	inline void LogWarning(AMX * const amx, const std::string &func,
		const std::string &format, Args &&...args)
	{
		LogWarning(amx, func, fmt::format(format, std::forward<Args>(args)...));
	}

private:
	std::atomic<PluginLogger_t> m_Logger;
};
{'fraction_non_alphanumeric': 0.18587542913192742, 'fraction_numerical': 0.0, 'mean_word_length': 5.078986587183309, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '172031', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1504, 'n_words': 338}