brintos

brintos / llvm-project-archived public Read only

0
0
Text · 760 B · 9f6fab9 Raw
34 lines · c
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_WHITE18};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 colored28// output, false otherwise.29bool IsColorTerminal();30 31}  // end namespace benchmark32 33#endif  // BENCHMARK_COLORPRINT_H_34