]> git.lizzy.rs Git - dragonfireclient.git/commit
Make logging cost free when there is no output target (#12247)
authorparadust7 <102263465+paradust7@users.noreply.github.com>
Wed, 4 May 2022 18:55:01 +0000 (11:55 -0700)
committerGitHub <noreply@github.com>
Wed, 4 May 2022 18:55:01 +0000 (20:55 +0200)
commit0704ca055059088bdd53e15be672e6b5663b8f50
tree26d12dc712e19fcc38e3a70ef598efc665ab0d7f
parentae7664597ed15f9ac779a9bac0595ab4125457c4
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.
14 files changed:
builtin/settingtypes.txt
minetest.conf.example
src/client/game.cpp
src/client/renderingengine.cpp
src/log.cpp
src/log.h
src/main.cpp
src/network/address.cpp
src/network/address.h
src/network/connection.cpp
src/network/connectionthreads.cpp
src/network/socket.cpp
src/server.cpp
src/util/stream.h [new file with mode: 0644]