summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/benchmark/src/log.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/benchmark/src/log.h')
-rw-r--r--3rdparty/benchmark/src/log.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/3rdparty/benchmark/src/log.h b/3rdparty/benchmark/src/log.h
new file mode 100644
index 00000000000..3777810e1c9
--- /dev/null
+++ b/3rdparty/benchmark/src/log.h
@@ -0,0 +1,28 @@
+#ifndef BENCHMARK_LOG_H_
+#define BENCHMARK_LOG_H_
+
+#include <ostream>
+
+namespace benchmark {
+namespace internal {
+
+int GetLogLevel();
+void SetLogLevel(int level);
+
+std::ostream& GetNullLogInstance();
+std::ostream& GetErrorLogInstance();
+
+inline std::ostream& GetLogInstanceForLevel(int level) {
+ if (level <= GetLogLevel()) {
+ return GetErrorLogInstance();
+ }
+ return GetNullLogInstance();
+}
+
+} // end namespace internal
+} // end namespace benchmark
+
+#define VLOG(x) (::benchmark::internal::GetLogInstanceForLevel(x) \
+ << "-- LOG(" << x << "): ")
+
+#endif \ No newline at end of file