2013-12-19 08:55:45 +08:00
|
|
|
#ifndef BENCHMARK_COLORPRINT_H_
|
|
|
|
#define BENCHMARK_COLORPRINT_H_
|
|
|
|
|
2016-05-28 03:34:37 +08:00
|
|
|
#include <cstdarg>
|
|
|
|
#include <iostream>
|
2016-10-08 02:35:03 +08:00
|
|
|
#include <string>
|
2016-05-28 03:34:37 +08:00
|
|
|
|
2013-12-20 08:18:09 +08:00
|
|
|
namespace benchmark {
|
2013-12-19 08:55:45 +08:00
|
|
|
enum LogColor {
|
|
|
|
COLOR_DEFAULT,
|
|
|
|
COLOR_RED,
|
|
|
|
COLOR_GREEN,
|
|
|
|
COLOR_YELLOW,
|
|
|
|
COLOR_BLUE,
|
|
|
|
COLOR_MAGENTA,
|
|
|
|
COLOR_CYAN,
|
|
|
|
COLOR_WHITE
|
|
|
|
};
|
|
|
|
|
2016-05-28 03:34:37 +08:00
|
|
|
std::string FormatString(const char* msg, va_list args);
|
|
|
|
std::string FormatString(const char* msg, ...);
|
|
|
|
|
2016-10-08 02:35:03 +08:00
|
|
|
void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
|
|
|
|
va_list args);
|
2016-05-28 03:34:37 +08:00
|
|
|
void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...);
|
|
|
|
|
2016-09-16 05:10:35 +08:00
|
|
|
// Returns true if stdout appears to be a terminal that supports colored
|
|
|
|
// output, false otherwise.
|
|
|
|
bool IsColorTerminal();
|
|
|
|
|
2013-12-20 08:18:09 +08:00
|
|
|
} // end namespace benchmark
|
2013-12-19 08:55:45 +08:00
|
|
|
|
|
|
|
#endif // BENCHMARK_COLORPRINT_H_
|