mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Extend RGBASM and RGBLINK verbosity flags to have multiple levels like RGBGFX (#1772)
This commit is contained in:
29
include/verbosity.hpp
Normal file
29
include/verbosity.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef RGBDS_VERBOSITY_HPP
|
||||
#define RGBDS_VERBOSITY_HPP
|
||||
|
||||
// This macro does not evaluate its arguments unless the condition is true.
|
||||
#define verbosePrint(level, ...) \
|
||||
do { \
|
||||
if (checkVerbosity(level)) { \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
enum Verbosity {
|
||||
VERB_NONE, // 0. Default, no extra output
|
||||
VERB_CONFIG, // 1. Basic configuration, after parsing CLI options
|
||||
VERB_NOTICE, // 2. Before significant actions
|
||||
VERB_INFO, // 3. Some intermediate action results
|
||||
VERB_DEBUG, // 4. Internals useful for debugging
|
||||
VERB_TRACE, // 5. Step-by-step algorithm details
|
||||
VERB_VVVVVV, // 6. What, can't I have a little fun?
|
||||
};
|
||||
|
||||
void incrementVerbosity();
|
||||
bool checkVerbosity(Verbosity level);
|
||||
|
||||
void printVVVVVVerbosity();
|
||||
|
||||
#endif // RGBDS_VERBOSITY_HPP
|
||||
Reference in New Issue
Block a user