2 inline void Logger::log(
Level lvl,
const T& msg) {
4 priv::Message logMsg(_name, lvl);
5 logMsg.raw.write(
"{}", msg);
7 }
catch (
const std::exception& ex) {
12 template<
typename... Args,
typename T>
13 inline void Logger::log(
Level lvl,
const T& fmt, Args&&... args) {
15 priv::Message logMsg(_name, lvl);
16 logMsg.raw.write(fmt, std::forward<Args>(args)...);
18 }
catch (
const std::exception& ex) {
19 defaultErrHandler(ex);
23 template<
typename T,
typename... Args>
24 inline void Logger::debug(
const T& fmt, Args&&... args) {
25 log(Level::Debug, fmt, std::forward<Args>(args)...);
28 template<
typename T,
typename... Args>
29 inline void Logger::info(
const T& fmt, Args&&... args) {
30 log(Level::Info, fmt, std::forward<Args>(args)...);
33 template<
typename T,
typename... Args>
34 inline void Logger::warn(
const T& fmt, Args&&... args) {
35 log(Level::Warning, fmt, std::forward<Args>(args)...);
38 template<
typename T,
typename... Args>
39 inline void Logger::error(
const T& fmt, Args&&... args) {
40 log(Level::Error, fmt, std::forward<Args>(args)...);
43 template<
typename T,
typename... Args>
44 inline void Logger::fatal(
const T& fmt, Args&&... args) {
45 log(Level::Fatal, fmt, std::forward<Args>(args)...);
48 template<
typename T,
typename... Args>
49 inline void Logger::assrt(
const T& fmt, Args&&... args) {
50 log(Level::Assert, fmt, std::forward<Args>(args)...);
54 inline Logger*
makeLogger(
const std::string& loggerName) {
55 std::unique_ptr<Logger> logger = std::make_unique<Logger>(loggerName);
56 Logger* loggerRawPtr = logger.get();
57 LoggingFacility::registerLogger(loggerName, std::move(logger));
Logger * makeLogger(const std::string &loggerName)