Functions
Logging.cxx File Reference
#include "WireCellUtil/Logging.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/null_sink.h"
#include <vector>

Go to the source code of this file.

Functions

static Log::logptr_t wct_base_logger ()
 

Function Documentation

static Log::logptr_t wct_base_logger ( )
static

Definition at line 13 of file Logging.cxx.

14 {
15  const std::string name = "wct";
16  static Log::logptr_t base_logger = nullptr;
17  if (base_logger) {
18  return base_logger;
19  }
20  base_logger = spdlog::get(name);
21  if (base_logger) {
22  return base_logger;
23  }
24 
25  std::vector<spdlog::sink_ptr> sv;
26  base_logger = std::make_shared<spdlog::logger>(name, sv.begin(), sv.end());
27  spdlog::register_logger(base_logger);
28  base_logger->debug("create default logger \"wct\"");
29  spdlog::set_default_logger(base_logger);
30 
31  return base_logger;
32 }
static QCString name
Definition: declinfo.cpp:673
std::shared_ptr< logger > get(const std::string &name)
Definition: spdlog.h:53
std::string string
Definition: nybbler.cc:12
void set_default_logger(std::shared_ptr< spdlog::logger > default_logger)
Definition: spdlog.h:159
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
void register_logger(std::shared_ptr< logger > logger)
Definition: spdlog.h:97