mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Make logging cost free when there is no output target (#12247)
The logging streams now do almost no work when there is no output target for them. For example, if LL_VERBOSE has no output targets, then `verbosestream << x` will return a StreamProxy with a null target. Any further `<<` operations applied to it will do nothing.
This commit is contained in:
@@ -1491,7 +1491,7 @@ bool Game::connectToServer(const GameStartData &start_data,
|
||||
client->m_simple_singleplayer_mode = simple_singleplayer_mode;
|
||||
|
||||
infostream << "Connecting to server at ";
|
||||
connect_address.print(&infostream);
|
||||
connect_address.print(infostream);
|
||||
infostream << std::endl;
|
||||
|
||||
client->connect(connect_address,
|
||||
|
Reference in New Issue
Block a user