Commit Graph

58 Commits

Author SHA1 Message Date
Le Philousophe cd9a1380a2 COMMON: Make debugLevelSet match with debug functions behaviour 2025-11-11 18:47:05 +01:00
Filippos Karapetis 5b1e2d502c COMMON: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Le Philousophe 0a4dd23113 COMMON: Remove plural of debugChannels
This variable previously held several channels while it's only used for
one channel now.
2025-02-22 23:28:26 +01:00
Eugene Sandulenko 6ae04dc157 COMMON: Added 'gvideo' global debug channel 2025-02-22 15:51:24 +01:00
Eugene Sandulenko 204af35019 COMMON: Added debug level for global graphics 2025-02-22 15:51:23 +01:00
Martin Gerhardy d0d366de50 COMMON: fixed whitespaces 2024-10-11 10:36:14 +02:00
Eugene Sandulenko 27503e46a2 COMMON: Implement sanity check to adding debug channels 2024-06-21 14:59:07 +02:00
Eugene Sandulenko e29828f9a6 COMMON: Avoid name clash for global GUI debug level 2024-05-26 23:42:10 +02:00
scemino 4325e2db00 COMMON: Add a log watcher 2024-05-24 12:39:29 +02:00
Eugene Sandulenko efb903204d COMMON: Added more global debug levels 2023-12-28 01:52:44 +01:00
Eugene Sandulenko bf3117e935 COMMON: Switch debug channels to a hashmap
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.
2023-12-28 01:41:10 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 83fc4f7338 COMMON: Persist global debug channels between engine runs 2021-08-16 21:33:15 +02:00
Eugene Sandulenko ed09f11eaa COMMON: Keep only one instance of global debug flags 2021-08-16 20:43:16 +02:00
sluicebox f2f28c4549 COMMON: Rename DebugManager methods, update comments 2021-06-14 12:42:38 -05:00
sluicebox efd4f9ff9d COMMON: Remove DebugManager::debugFlagsClear() 2021-06-14 12:42:38 -05:00
sluicebox fa247d13de COMMON: Rename DebugManager global/member names 2021-06-14 12:42:38 -05:00
ysj1173886760 44e2285003 BASE: add duplicate debug channel check for addDebugChannel 2021-05-22 01:34:57 +02:00
ysj1173886760 d2ea7cea88 COMMON: fix the bug when using default implementation of getDebugChannel 2021-05-22 01:34:57 +02:00
ysj1173886760 a64a097ca3 COMMON: change passing pointer instead of passing the array when passing the debug channels 2021-05-22 01:34:57 +02:00
ysj1173886760 9609406205 COMMON: introduce debugFlagsClear and debugFlagsRegister to debug manager 2021-05-22 01:34:57 +02:00
Paul Gilbert d51d3d4086 COMMON: Allow for enabling/disabling debug channels by number 2019-11-11 18:20:29 -08:00
Eugene Sandulenko 940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat eefa72afa1 COMMON: Change way the Singleton instances are instantiated
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.
2017-07-10 21:11:20 +02:00
Eugene Sandulenko eab2e06169 COMMON: Enhanced debug channel checks.
Now it is possible to enforce checking by specifying level -1,
that is, debug level 11 will not turn it on.
2017-01-09 09:22:35 +01:00
Eugene Sandulenko 0ab903a9e2 COMMON: Added checkers for debug channels.
Sometimes there is a need to add debug execution and enable it from
the command line. Now it is possible, both with debug levels and channels
2016-08-19 09:55:22 +02:00
Eugene Sandulenko 0fdab36710 COMMON: Introduce --debug-channels-only command line flag.
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.
2016-08-13 21:07:43 +02:00
Johannes Schickel 559c10e91a COMMON: Don't allow debug channel 'all' to be used. 2014-06-05 16:32:27 +02:00
D G Turner 1e6fe10e3d COMMON: Add "all" option to debugflag controls in GUI Debugger. 2014-06-05 02:18:58 +01:00
Johannes Schickel 854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel b4d0a8ba66 JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
Johannes Schickel 7e4224e52a COMMON: Fix compilation when USE_HASHMAP_MEMORY_POOL is not defined. 2011-07-03 00:16:07 +02:00
Ori Avtalion aa0f307e06 ALL: Require DECLARE_SINGLETON to be used in the Common namepsace
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.
2011-06-30 22:41:41 +03:00
Max Horn b81207a04e COMMON: Replace some vsnprintf/STRINGBUFLEN uses by vformat 2011-06-18 01:36:16 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel e1030e53a5 BACKENDS: Implement logging API proposed by Max on -devel.
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
2010-11-18 19:12:14 +00:00
Max Horn abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
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
2010-11-16 08:23:13 +00:00
Max Horn 75c6e66874 COMMON: Get rid of the debug() output formatter
Now Engine::errorString is only used by error(), as its name suggests.
This also resolves the inconsistency between debug & debugN.

svn-id: r54023
2010-11-01 20:41:32 +00:00
Max Horn 0cf64915e1 COMMON: Add debugN variant without level parameter
This makes our various debug*() functions fully symmetric, for now.

svn-id: r54008
2010-11-01 16:03:50 +00:00
Max Horn a41d4424af COMMON: Allow forbidden symbols in debug.cpp and textconsole.cpp
This is currently necessary for the PS2 port and possibly others.

svn-id: r53989
2010-10-31 21:49:53 +00:00
Max Horn 970745e60c Move DebugChannel related code to new header
svn-id: r48935
2010-05-04 11:59:22 +00:00
Max Horn 460d69e885 COMMON: Move DebugChannel stuff into a new DebugMan singleton
svn-id: r48821
2010-04-27 21:40:52 +00:00
Max Horn 445dccd59b cleanup
svn-id: r48820
2010-04-27 21:39:43 +00:00
Johannes Schickel 71331c7f53 Fix regression introduced with r46130, which caused debugN strings to be post processed via debugOutputFormatter.
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
2010-04-19 12:50:49 +00:00
Johannes Schickel 676bebe2be - Call the special debug channels "channels" consistently. (Formerly sometimes they were refered to as "levels").
- Along with it add some more descriptive commentary about what is the intention behind debug channels.

svn-id: r47727
2010-01-30 19:23:00 +00:00
Fabio Battaglia 3a418c13a7 remove bad hackery caused by n64 port and avoid polluting StdioStream using a custom Stream subclass
svn-id: r46777
2009-12-30 22:56:19 +00:00
Fabio Battaglia a108df30a7 Add Nintendo 64 port to trunk.
svn-id: r46773
2009-12-30 21:11:38 +00:00
Max Horn 1a313a7eca COMMON: Remove dependency on engines code (by using the inversion principle).
svn-id: r46130
2009-11-24 22:11:07 +00:00
Max Horn 3d342bec3c PS2 & NDS: Remove ps2_fprintf and some useless typedefs and #defines; use fputs instead of fprintf
svn-id: r46107
2009-11-23 22:29:39 +00:00