aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorparadust7 <102263465+paradust7@users.noreply.github.com>2022-05-04 11:55:01 -0700
committerGitHub <noreply@github.com>2022-05-04 20:55:01 +0200
commit0704ca055059088bdd53e15be672e6b5663b8f50 (patch)
tree26d12dc712e19fcc38e3a70ef598efc665ab0d7f /src/client
parentae7664597ed15f9ac779a9bac0595ab4125457c4 (diff)
downloadminetest-0704ca055059088bdd53e15be672e6b5663b8f50.tar.gz
minetest-0704ca055059088bdd53e15be672e6b5663b8f50.tar.bz2
minetest-0704ca055059088bdd53e15be672e6b5663b8f50.zip
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.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/game.cpp2
-rw-r--r--src/client/renderingengine.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index e0e60eb2c..1e34ca286 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -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,
diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp
index 723865db4..455d5e538 100644
--- a/src/client/renderingengine.cpp
+++ b/src/client/renderingengine.cpp
@@ -116,7 +116,7 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
}
SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
- if (g_logger.getTraceEnabled())
+ if (tracestream)
params.LoggingLevel = irr::ELL_DEBUG;
params.DriverType = driverType;
params.WindowSize = core::dimension2d<u32>(screen_w, screen_h);