mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user