1#ifndef BENCHMARK_LOG_H_
2#define BENCHMARK_LOG_H_
7#include "benchmark/benchmark.h"
12typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&);
15 friend LogType& GetNullLogInstance();
16 friend LogType& GetErrorLogInstance();
24 LogType(std::ostream* out) : out_(out) {}
26 BENCHMARK_DISALLOW_COPY_AND_ASSIGN(
LogType);
37inline LogType& operator<<(LogType& log, EndLType* m) {
44inline int& LogLevel() {
45 static int log_level = 0;
49inline LogType& GetNullLogInstance() {
50 static LogType log(
nullptr);
54inline LogType& GetErrorLogInstance() {
55 static LogType log(&std::clog);
59inline LogType& GetLogInstanceForLevel(
int level) {
60 if (level <= LogLevel()) {
61 return GetErrorLogInstance();
63 return GetNullLogInstance();
71 (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \