summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/benchmark/src/log.cc
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/benchmark/src/log.cc')
-rw-r--r--3rdparty/benchmark/src/log.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/3rdparty/benchmark/src/log.cc b/3rdparty/benchmark/src/log.cc
new file mode 100644
index 00000000000..b660309d324
--- /dev/null
+++ b/3rdparty/benchmark/src/log.cc
@@ -0,0 +1,40 @@
+#include "log.h"
+
+#include <iostream>
+
+namespace benchmark {
+namespace internal {
+
+int& LoggingLevelImp() {
+ static int level = 0;
+ return level;
+}
+
+void SetLogLevel(int value) {
+ LoggingLevelImp() = value;
+}
+
+int GetLogLevel() {
+ return LoggingLevelImp();
+}
+
+class NullLogBuffer : public std::streambuf
+{
+public:
+ int overflow(int c) {
+ return c;
+ }
+};
+
+std::ostream& GetNullLogInstance() {
+ static NullLogBuffer log_buff;
+ static std::ostream null_log(&log_buff);
+ return null_log;
+}
+
+std::ostream& GetErrorLogInstance() {
+ return std::clog;
+}
+
+} // end namespace internal
+} // end namespace benchmark \ No newline at end of file