@@ -100,25 +100,21 @@ TEST_F(LoggingTest, DocsData) {
100100}
101101
102102TEST_F (LoggingTest, DocsDataInline) {
103- // / [Sample logging usage]
104103 LOG_TRACE (" Very verbose logs, only enabled using dynamic debug logs" );
105104 LOG_DEBUG (" Some debug info, not logged by default in production" );
106105 LOG_INFO (" This is informational message" );
107106 LOG_WARNING (" Something strange happened" );
108107 LOG_ERROR (" This is unbelievable, fix me, please!" );
109108 LOG_CRITICAL (" The service is about to abort, bye" );
110- // / [Sample logging usage]
111109}
112110
113111TEST_F (LoggingTest, DocsDataInlineFormat) {
114- // / [Sample logging usage]
115112 LOG_TRACE (" Very {} logs, only enabled using dynamic debug logs" , " verbose" );
116113 LOG_DEBUG (" Some {} info, not logged by default in production" , " debug" );
117114 LOG_INFO (" This is {} message" , " informational" );
118115 LOG_WARNING (" Something {} happened" , " strange" );
119116 LOG_ERROR (" This is {}, fix me, please!" , " unbelievable" );
120117 LOG_CRITICAL (" The service is about to {}, bye" , " abort" );
121- // / [Sample logging usage]
122118
123119 // NOTE: Should not be compilable!
124120 // LOG_WARNING(fmt::format("Something {} happened", "strange"));
@@ -248,20 +244,18 @@ TEST_F(LoggingTest, LoggingNestedStructures) {
248244 }
249245 out << " ]" ;
250246 };
251- // / [Example Logging Nested Structures]
252247 EXPECT_EQ (" Records: [{foo=1, bar=x}, {foo=2, bar=y}, ]" , LoggedText ());
253-
254248 ClearLog ();
255- // / [Example Logging Nested Structures]
249+
256250 LOG_INFO () << [&list](auto & out) {
257251 out << " Records: [" ;
258252 for (const auto & item : list) {
259253 out.Format (" {{foo={}, bar={}}}, " , item.foo , item.bar );
260254 }
261255 out << " ]" ;
262256 };
263- // / [Example Logging Nested Structures]
264257 EXPECT_EQ (" Records: [{foo=1, bar=x}, {foo=2, bar=y}, ]" , LoggedText ());
258+ // / [Example Logging Nested Structures]
265259}
266260
267261USERVER_NAMESPACE_END
0 commit comments