add get_spdlog_logger() internal utility
This commit is contained in:
parent
76d345486e
commit
4dcaf2ee47
1 changed files with 20 additions and 0 deletions
20
src/internal/mnode_spdlog.hpp
Normal file
20
src/internal/mnode_spdlog.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef A9EC2321_3F3B_49F7_9948_3F7C0983B312
|
||||
#define A9EC2321_3F3B_49F7_9948_3F7C0983B312
|
||||
|
||||
#include <spdlog/sinks/stdout_color_sinks.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace mesytec::mnode
|
||||
{
|
||||
|
||||
inline std::shared_ptr<spdlog::logger> get_spdlog_logger(const std::string &name)
|
||||
{
|
||||
if (auto logger = spdlog::get(name))
|
||||
return logger;
|
||||
|
||||
return spdlog::stdout_color_mt(name);
|
||||
}
|
||||
|
||||
} // namespace mesytec::mnode
|
||||
|
||||
#endif /* A9EC2321_3F3B_49F7_9948_3F7C0983B312 */
|
Loading…
Reference in a new issue