43 #define ACTS_LOCAL_LOGGER(log_object) \
44 struct __local_acts_logger \
46 __local_acts_logger(std::unique_ptr<const ::Acts::Logger> logger): \
47 m_logger(std::move(logger)) \
50 const ::Acts::Logger& operator()() const \
55 std::unique_ptr<const ::Acts::Logger> m_logger; \
57 __local_acts_logger logger(log_object);
69 #define ACTS_VERBOSE(x) \
70 if (logger().doPrint(Acts::Logging::VERBOSE)) \
71 logger().log(Acts::Logging::VERBOSE) << x;
83 #define ACTS_DEBUG(x) \
84 if (logger().doPrint(Acts::Logging::DEBUG)) \
85 logger().log(Acts::Logging::DEBUG) << x;
97 #define ACTS_INFO(x) \
98 if (logger().doPrint(Acts::Logging::INFO)) \
99 logger().log(Acts::Logging::INFO) << x;
111 #define ACTS_WARNING(x) \
112 if (logger().doPrint(Acts::Logging::WARNING)) \
113 logger().log(Acts::Logging::WARNING) << x;
125 #define ACTS_ERROR(x) \
126 if (logger().doPrint(Acts::Logging::ERROR)) \
127 logger().log(Acts::Logging::ERROR) << x;
139 #define ACTS_FATAL(x) \
140 if (logger().doPrint(Acts::Logging::FATAL)) \
141 logger().log(Acts::Logging::FATAL) << x;
175 virtual void flush(
const Level& lvl,
const std::ostringstream& input) = 0;
203 using OutputFunc = std::function<void(const std::ostringstream&)>;
232 template <
typename T>
234 m_stream << std::forward<T>(input);
243 template <
typename T>
304 void flush(
const Level& lvl,
const std::ostringstream& input)
override {
324 const std::string&
name,
unsigned int maxWidth = 15)
336 void flush(
const Level& lvl,
const std::ostringstream& input)
override {
337 std::ostringstream os;
361 const std::string& format =
"%X")
371 void flush(
const Level& lvl,
const std::ostringstream& input)
override {
372 std::ostringstream os;
373 os <<
std::left << std::setw(12) <<
now() << input.str();
385 std::strftime(buffer,
sizeof(buffer),
m_format.c_str(), localtime(&t));
411 void flush(
const Level& lvl,
const std::ostringstream& input)
override {
412 std::ostringstream os;
413 os <<
std::left << std::setw(20) << std::this_thread::get_id()
437 void flush(
const Level& lvl,
const std::ostringstream& input)
override {
438 std::ostringstream os;
450 static const char*
const buffer[] = {
"VERBOSE",
"DEBUG",
"INFO",
451 "WARNING",
"ERROR",
"FATAL"};
473 void flush(
const Level& ,
const std::ostringstream& input)
final {
474 (*m_out) << input.str() << std::endl;
495 Logger(std::unique_ptr<Logging::OutputPrintPolicy> pPrint,
496 std::unique_ptr<Logging::OutputFilterPolicy> pFilter)
521 std::placeholders::_1));
547 std::ostream* log_stream = &std::cout);