Skip to content
Permalink
Browse files

Merge pull request #39567 from elpaso/server-standalone-colorize

Server standalone colorize output
  • Loading branch information
elpaso committed Oct 30, 2020
2 parents ce466a4 + 7272f27 commit f5ba02ec1409f21bed616084a2a7204136d74486
@@ -417,7 +417,7 @@ int main( int argc, char *argv[] )
clientConnection->write( body );

// 10.185.248.71 [09/Jan/2015:19:12:06 +0000] 808840 <time> "GET / HTTP/1.1" 500"
std::cout << QStringLiteral( "%1 [%2] %3 %4ms \"%5\" %6" )
std::cout << QStringLiteral( "\033[1;92m%1 [%2] %3 %4ms \"%5\" %6\033[0m" )
.arg( clientConnection->peerAddress().toString(),
QDateTime::currentDateTime().toString(),
QString::number( body.size() ),
@@ -443,7 +443,7 @@ int main( int argc, char *argv[] )
clientConnection->write( "\r\n" );
clientConnection->write( ex.message().toUtf8() );

std::cout << QStringLiteral( "%1 [%2] \"%3\" - - 500" )
std::cout << QStringLiteral( "\033[1;31m%1 [%2] \"%3\" - - 500\033[0m" )
.arg( clientConnection->peerAddress().toString() )
.arg( QDateTime::currentDateTime().toString() )
.arg( ex.message() ).toStdString() << std::endl;
Binary file not shown.
Binary file not shown.

0 comments on commit f5ba02e

Please sign in to comment.
You can’t perform that action at this time.