1#ifndef BENCHMARK_COLORPRINT_H_
2#define BENCHMARK_COLORPRINT_H_
3
4#include <cstdarg>
5#include <iostream>
6#include <string>
7
8namespace benchmark {
9enum LogColor {
10 COLOR_DEFAULT,
11 COLOR_RED,
12 COLOR_GREEN,
13 COLOR_YELLOW,
14 COLOR_BLUE,
15 COLOR_MAGENTA,
16 COLOR_CYAN,
17 COLOR_WHITE
18};
19
20std::string FormatString(const char* msg, va_list args);
21std::string FormatString(const char* msg, ...);
22
23void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
24 va_list args);
25void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...);
26
27// Returns true if stdout appears to be a terminal that supports colored
28// output, false otherwise.
29bool IsColorTerminal();
30
31} // end namespace benchmark
32
33#endif // BENCHMARK_COLORPRINT_H_
34