Skip to content

Commit a9e5f44

Browse files
committed
Add "-u" option to the server (disables stdout buffering)
1 parent a6e2554 commit a9e5f44

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Server/core/CServerImpl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,11 @@ bool CServerImpl::ParseArguments ( int iArgumentCount, char* szArguments [] )
938938
g_bNoCurses = false;
939939
#endif
940940
}
941+
else if ( strcmp ( szArguments[i], "-u" ) == 0 )
942+
{
943+
std::setbuf ( stdout, nullptr) ;
944+
std::setbuf ( stderr, nullptr );
945+
}
941946
else if ( strcmp ( szArguments [i], "-x" ) == 0 )
942947
{
943948
g_bNoCrashHandler = true;

Server/launcher/Main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ int main ( int argc, char* argv [] )
105105
printf ( " -t Run server with a simple console\n" );
106106
printf ( " -f Run server with a standard console (Default)\n" );
107107
printf ( " -n Disable the usage of ncurses (For screenlog)\n" );
108+
printf ( " -u Disable output buffering and flush instantly (useful for screenlog)\n" );
108109
#ifndef WIN32
109110
printf ( " -x Disable simplified crash reports (To allow core dumps)\n" );
110111
printf ( " -q Do not add " LINUX_LIBS_PATH " directory to library search path\n" );

0 commit comments

Comments
 (0)