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