NAIA  1.1.1
Logging.h
Go to the documentation of this file.
1 #ifndef NAIA_LOGGING_H
2 #define NAIA_LOGGING_H
3 
4 #include "spdlog/sinks/stdout_color_sinks.h"
5 #include "spdlog/spdlog.h"
6 
7 #include <string_view>
8 
9 namespace NAIA {
10 namespace Logging {
11 void MuteOutput();
12 void UnmuteOutput();
13 } // namespace Logging
14 
20 inline auto getLogger(std::string_view fnName) {
21  auto logger = spdlog::get(fnName.data());
22  if (!logger)
23  logger = spdlog::stdout_color_st(fnName.data());
24  return logger;
25 }
26 } // namespace NAIA
27 
28 #endif
NAIA::Logging::UnmuteOutput
void UnmuteOutput()
Definition: Logging.cpp:36
NAIA
Definition: Event.h:13
NAIA::getLogger
auto getLogger(std::string_view fnName)
Create a new logger with a given function name.
Definition: Logging.h:20
NAIA::Logging::MuteOutput
void MuteOutput()
Definition: Logging.cpp:22