1#ifndef BENCHMARK_LOG_H_
2#define BENCHMARK_LOG_H_
10typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&);
13 friend LogType& GetNullLogInstance();
14 friend LogType& GetErrorLogInstance();
22 LogType(std::ostream* out) : out_(out) {}
39inline LogType& operator<<(LogType& log, EndLType* m) {
46inline int& LogLevel() {
47 static int log_level = 0;
51inline LogType& GetNullLogInstance() {
52 static LogType null_log(
static_cast<std::ostream*
>(
nullptr));
56inline LogType& GetErrorLogInstance() {
57 static LogType error_log(&std::clog);
61inline LogType& GetLogInstanceForLevel(
int level) {
62 if (level <= LogLevel()) {
63 return GetErrorLogInstance();
65 return GetNullLogInstance();
73 (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \