@@ -79,8 +79,8 @@ void TActionContext::execute(THttpRequest &request)
7979 accessLogger.startElapsedTimer ();
8080 }
8181
82- tSystemDebug (" method : %s " , reqHeader.method ().data ());
83- tSystemDebug (" path : %s " , reqHeader.path ().data ());
82+ tSystemDebug (" method : {} " , reqHeader.method ().data ());
83+ tSystemDebug (" path : {} " , reqHeader.path ().data ());
8484
8585 // HTTP method
8686 Tf::HttpMethod method = _httpRequest->method ();
@@ -94,7 +94,7 @@ void TActionContext::execute(THttpRequest &request)
9494 QStringList components = TUrlRoute::splitPath (path);
9595 TRouting route = TUrlRoute::instance ().findRouting (method, components);
9696
97- tSystemDebug (" Routing: controller:%s action:%s " , route.controller .data (),
97+ tSystemDebug (" Routing: controller:{} action:{} " , route.controller .data (),
9898 route.action .data ());
9999
100100 if (!route.exists ) {
@@ -112,7 +112,7 @@ void TActionContext::execute(THttpRequest &request)
112112 route.setRouting (c + QByteArrayLiteral (" controller" ), action, components.mid (2 ));
113113 }
114114 }
115- tSystemDebug (" Active Controller : %s " , route.controller .data ());
115+ tSystemDebug (" Active Controller : {} " , route.controller .data ());
116116 }
117117 }
118118
@@ -152,7 +152,7 @@ void TActionContext::execute(THttpRequest &request)
152152 TSessionManager::instance ().remove (_currController->session ().sessionId ); // Removes the old session
153153 // Re-generate session ID
154154 _currController->session ().sessionId = TSessionManager::instance ().generateId ();
155- tSystemDebug (" Re-generate session ID: %s " , _currController->session ().sessionId .data ());
155+ tSystemDebug (" Re-generate session ID: {} " , _currController->session ().sessionId .data ());
156156 }
157157
158158 if (EnableCsrfProtectionModuleFlag && _currController->csrfProtectionEnabled ()) {
@@ -199,7 +199,7 @@ void TActionContext::execute(THttpRequest &request)
199199 QString canonicalPath = QUrl (QStringLiteral (" ." )).resolved (QUrl (path)).toString ().mid (1 );
200200 QFile reqPath (Tf::app ()->publicPath () + canonicalPath);
201201 QFileInfo fi (reqPath);
202- tSystemDebug (" canonicalPath : %s " , qUtf8Printable (canonicalPath));
202+ tSystemDebug (" canonicalPath : {} " , qUtf8Printable (canonicalPath));
203203
204204 if (fi.isFile () && fi.isReadable ()) {
205205 // Check "If-Modified-Since" header for caching
@@ -244,20 +244,20 @@ void TActionContext::execute(THttpRequest &request)
244244 }
245245
246246 } catch (ClientErrorException &e) {
247- tWarn (" Caught %s : status code:%d " , qUtf8Printable (e.className ()), e.statusCode ());
248- tSystemWarn (" Caught %s : status code:%d " , qUtf8Printable (e.className ()), e.statusCode ());
247+ Tf::warn (" Caught {} : status code:{} " , qUtf8Printable (e.className ()), e.statusCode ());
248+ tSystemWarn (" Caught {} : status code:{} " , qUtf8Printable (e.className ()), e.statusCode ());
249249 int responseBytes = writeResponse (e.statusCode (), responseHeader);
250250 accessLogger.setResponseBytes (responseBytes);
251251 accessLogger.setStatusCode (e.statusCode ());
252252 } catch (TfException &e) {
253- tError (" Caught %s: %s [%s:%d ]" , qUtf8Printable (e.className ()), qUtf8Printable (e.message ()), qUtf8Printable (e.fileName ()), e.lineNumber ());
254- tSystemError (" Caught %s: %s [%s:%d ]" , qUtf8Printable (e.className ()), qUtf8Printable (e.message ()), qUtf8Printable (e.fileName ()), e.lineNumber ());
253+ Tf::error (" Caught {}: {} [{}:{} ]" , qUtf8Printable (e.className ()), qUtf8Printable (e.message ()), qUtf8Printable (e.fileName ()), e.lineNumber ());
254+ tSystemError (" Caught {}: {} [{}:{} ]" , qUtf8Printable (e.className ()), qUtf8Printable (e.message ()), qUtf8Printable (e.fileName ()), e.lineNumber ());
255255 closeSocket ();
256256 accessLogger.setResponseBytes (0 );
257257 accessLogger.setStatusCode (Tf::InternalServerError);
258258 } catch (std::exception &e) {
259- tError (" Caught Exception: %s " , e.what ());
260- tSystemError (" Caught Exception: %s " , e.what ());
259+ Tf::error (" Caught Exception: {} " , e.what ());
260+ tSystemError (" Caught Exception: {} " , e.what ());
261261 closeSocket ();
262262 accessLogger.setResponseBytes (0 );
263263 accessLogger.setStatusCode (Tf::InternalServerError);
@@ -374,7 +374,7 @@ void TActionContext::flushResponse(TActionController *controller, bool immediate
374374 } break ;
375375
376376 default :
377- tSystemError (" Invalid logic [%s:%d ]" , __FILE__, __LINE__);
377+ tSystemError (" Invalid logic [{}:{} ]" , __FILE__, __LINE__);
378378 break ;
379379 }
380380 }
@@ -463,7 +463,7 @@ int64_t TActionContext::writeResponse(THttpResponseHeader &header, QIODevice *bo
463463{
464464
465465 header.setContentLength (length);
466- tSystemDebug (" content-length: %lld " , (int64_t )header.contentLength ());
466+ tSystemDebug (" content-length: {} " , (int64_t )header.contentLength ());
467467 header.setRawHeader (QByteArrayLiteral (" Server" ), QByteArrayLiteral (" TreeFrog server" ));
468468 header.setCurrentDate ();
469469
0 commit comments