Go to the source code of this file.
|
| | TEST (GlogFormatter, log) |
| |
| | TEST (GlogFormatter, filename) |
| |
| | TEST (GlogFormatter, multiline) |
| |
| | TEST (GlogFormatter, singleNewline) |
| |
| | TEST (GlogFormatter, unprintableChars) |
| |
| int | main (int argc, char *argv[]) |
| |
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
| TEST |
( |
GlogFormatter |
, |
|
|
log |
|
|
) |
| |
Definition at line 66 of file GlogFormatterTest.cpp.
References EXPECT_EQ, folly::getOSThreadID(), folly::sformat(), and folly::WARN.
71 "W0417 13:45:56.123456 {:5d} myfile.cpp:1234] hello world\n", tid);
75 LogLevel::WARN,
"hello world",
"myfile.cpp", 1234,
"testFunction"));
std::string sformat(StringPiece fmt, Args &&...args)
#define EXPECT_EQ(val1, val2)
| TEST |
( |
GlogFormatter |
, |
|
|
filename |
|
|
) |
| |
Definition at line 78 of file GlogFormatterTest.cpp.
References EXPECT_EQ, folly::getOSThreadID(), folly::sformat(), and folly::WARN.
83 "W0417 13:45:56.123456 {:5d} myfile.cpp:1234] hello world\n", tid);
89 "src/test/logging/code/myfile.cpp",
95 "W0417 13:45:56.123456 {:5d} " 96 "this_is_a_really_long_file_name_that_will_probably_exceed_" 97 "our_buffer_allocation_guess.cpp:123456789] oh noes\n",
104 "this_is_a_really_long_file_name_that_will_probably_exceed_" 105 "our_buffer_allocation_guess.cpp",
std::string sformat(StringPiece fmt, Args &&...args)
#define EXPECT_EQ(val1, val2)
| TEST |
( |
GlogFormatter |
, |
|
|
multiline |
|
|
) |
| |
Definition at line 110 of file GlogFormatterTest.cpp.
References folly::DBG9, EXPECT_EQ, folly::getOSThreadID(), and folly::svformat().
112 std::map<std::string, std::string> formatMap{
113 {
"tid", folly::to<std::string>(tid)}};
117 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] Eeek, a mouse!\n" 118 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] . .\n" 119 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] ( ).( )\n" 120 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] (o o) .-._.'\n" 121 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] ( - )\n" 122 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] mm mm\n" 123 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] \n" 124 "V0417 13:45:56.123456 {tid:>5s} rodent.cpp:777] =============\n",
#define EXPECT_EQ(val1, val2)
std::string svformat(StringPiece fmt, Container &&container)
| TEST |
( |
GlogFormatter |
, |
|
|
singleNewline |
|
|
) |
| |
Definition at line 143 of file GlogFormatterTest.cpp.
References folly::DBG9, EXPECT_EQ, folly::getOSThreadID(), and folly::svformat().
145 std::map<std::string, std::string> formatMap{
146 {
"tid", folly::to<std::string>(tid)}};
150 "V0417 13:45:56.123456 {tid:>5s} foo.txt:123] \n" 151 "V0417 13:45:56.123456 {tid:>5s} foo.txt:123] \n",
155 formatMsg(LogLevel::DBG9,
"\n",
"foo.txt", 123,
"testFunction"));
#define EXPECT_EQ(val1, val2)
std::string svformat(StringPiece fmt, Container &&container)
| TEST |
( |
GlogFormatter |
, |
|
|
unprintableChars |
|
|
) |
| |
Definition at line 158 of file GlogFormatterTest.cpp.
References folly::CRITICAL, folly::ERR, EXPECT_EQ, folly::getOSThreadID(), folly::INFO, folly::sformat(), and string.
163 "E0417 13:45:56.123456 {:5d} escapes.cpp:97] foo\\x07bar\\x1btest\n",
174 "I0417 13:45:56.123456 {:5d} escapes.cpp:98] foo\\\\bar\"test\n", tid);
178 LogLevel::INFO,
"foo\\bar\"test",
"escapes.cpp", 98,
"testFunction"));
180 "C0417 13:45:56.123456 {:5d} escapes.cpp:99] nul\\x00byte\n", tid);
std::string sformat(StringPiece fmt, Args &&...args)
#define EXPECT_EQ(val1, val2)