We used to use a bitfield there, which was restricting the total
number of flags to 32 (unless we switch to uint64, which is suboptimal).
Moreover, with the introduction of the global debug flags, we have
even fewer bits to flip, and this shared nature was restricting
the introduction of more global debug channels.
The goal for the bitfield was to make it possible to put a debug message into
more than one channel. But this feature was practically not used by the engines.
This was removed by the previous commits.
This commit turns the debug channels into a hashmap and puts the global channel
IDs after 100000.
There is no absolute need to renumber the existing debug channels, but
I could follow with an engine or two.
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
Many of our systems currently generate significant amount of debug
output on deeper levels. Now, when your engine is using Debug Channels,
you might want to show that debug information only, which is currently
not possible, as the generic output will be mixed in your output.
Alternative solution would be to implement possibility to specify
per-channel debug levels.
Silences the clang warning:
static data member specialization of '_singleton' must
originally be declared in namespace 'Common'; accepted as a C++0x
extension [-Wc++0x-extensions]
Wrapping "namespace Common {}" around the macro assignment causes clang
to complain about a spurious semicolon, and removing the semicolon at
the end of the macro causes some editors to misbehave.
Changing the requirement of using the macro in one namespace (the
global) to another (Common) seems a small price to pay to
silence a warning.
This commits a slightly modified patch from my patch tracker item #3104630
"OSYSTEM: Add logging API as proposed by Max on -devel".
I was not able to test compilation on Android and SamsungTV, since there is no
toolchain for those on buildbot (or I was too blind to find them).
svn-id: r54339
This makes it possible to write
DECLARE_SINGLETON(foo);
instead of
DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.
svn-id: r54258
Formerly all debugN strings were not post processed via "errorString" (or the
"debugOutputFormatter" as it is called nowadays). This revision did change
how debug strings are post processed and removed the special case for debugN
by accident.
svn-id: r48716