Transmitter::Debug implementation 1/2

This also sorts switch() and listen_to() statements in order
of severity: debug, info, warning, error, fatal, throw.
This commit is contained in:
Robin Gareus
2020-10-13 21:46:52 +02:00
parent 51871489ad
commit e4e94e77c9
14 changed files with 128 additions and 88 deletions

View File

@@ -76,15 +76,18 @@ class DummyReceiver : public Receiver {
void receive (Transmitter::Channel chn, const char * str) {
const char *prefix = "";
switch (chn) {
case Transmitter::Error:
prefix = "[ERROR]: ";
break;
case Transmitter::Debug:
/* ignore */
return;
case Transmitter::Info:
/* ignore */
return;
case Transmitter::Warning:
prefix = "[WARNING]: ";
break;
case Transmitter::Error:
prefix = "[ERROR]: ";
break;
case Transmitter::Fatal:
prefix = "[FATAL]: ";
break;
@@ -130,10 +133,9 @@ int main (int argc, char **argv) {
PBD::init();
dummy_receiver.listen_to (error);
dummy_receiver.listen_to (info);
dummy_receiver.listen_to (fatal);
dummy_receiver.listen_to (warning);
dummy_receiver.listen_to (error);
dummy_receiver.listen_to (fatal);
std::vector<VSTInfo *> *infos = 0;

View File

@@ -52,8 +52,8 @@ protected:
void receive (Transmitter::Channel chn, const char * str) {
const char *prefix = "";
switch (chn) {
case Transmitter::Error:
prefix = "[ERROR]: ";
case Transmitter::Debug:
/* ignore */
break;
case Transmitter::Info:
prefix = "[Info]: ";
@@ -61,6 +61,9 @@ protected:
case Transmitter::Warning:
prefix = "[WARNING]: ";
break;
case Transmitter::Error:
prefix = "[ERROR]: ";
break;
case Transmitter::Fatal:
prefix = "[FATAL]: ";
break;
@@ -191,10 +194,10 @@ main (int argc, char **argv)
PBD::init();
if (print_log) {
log_receiver.listen_to (error);
log_receiver.listen_to (info);
log_receiver.listen_to (fatal);
log_receiver.listen_to (warning);
log_receiver.listen_to (error);
log_receiver.listen_to (fatal);
}
bool err = false;