All checks were successful
Build (Arch Linux) / build (push) Successful in 3m30s
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "logging/logger.hpp"
|
|
|
|
#include <format>
|
|
#include <utility>
|
|
|
|
namespace kuiper
|
|
{
|
|
|
|
/// @brief Singleton class providing engine-wide logging facilities
|
|
class engine_logger {
|
|
private:
|
|
engine_logger() = default;
|
|
|
|
public:
|
|
~engine_logger() = default;
|
|
|
|
public:
|
|
static inline engine_logger& get(void) {
|
|
static engine_logger s_instance;
|
|
return s_instance;
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void trace(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.trace(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void debug(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.debug(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void info(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.info(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void warn(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.warn(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void error(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.error(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template<typename... Args>
|
|
inline void critical(std::format_string<Args...> fmt, Args... args) {
|
|
m_log.critical(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
private:
|
|
kuiper::logger m_log {"engine"};
|
|
};
|
|
|
|
} // namespace kuiper
|