Transmitter::Debug implementation 2/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:51:39 +02:00
parent e4e94e77c9
commit 1698928f3d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 18 additions and 11 deletions

View File

@ -61,15 +61,18 @@ LogReceiver::receive (Transmitter::Channel chn, const char * str)
const char *prefix = ""; const char *prefix = "";
switch (chn) { switch (chn) {
case Transmitter::Error: case Transmitter::Debug:
prefix = "[ERROR]: "; /* ignore */
break; return;
case Transmitter::Info: case Transmitter::Info:
prefix = "[INFO]: "; prefix = "[INFO]: ";
break; break;
case Transmitter::Warning: case Transmitter::Warning:
prefix = "[WARNING]: "; prefix = "[WARNING]: ";
break; break;
case Transmitter::Error:
prefix = "[ERROR]: ";
break;
case Transmitter::Fatal: case Transmitter::Fatal:
prefix = "[FATAL]: "; prefix = "[FATAL]: ";
break; break;
@ -265,9 +268,9 @@ int main (int argc, char **argv)
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
log_receiver.listen_to (error);
log_receiver.listen_to (info); log_receiver.listen_to (info);
log_receiver.listen_to (fatal); log_receiver.listen_to (fatal);
log_receiver.listen_to (error);
log_receiver.listen_to (warning); log_receiver.listen_to (warning);
if (UIConfiguration::instance().pre_gui_init ()) { if (UIConfiguration::instance().pre_gui_init ()) {

View File

@ -290,10 +290,11 @@ int main (int argc, char *argv[])
// catch error message system signals (); // catch error message system signals ();
text_receiver.listen_to (error); text_receiver.listen_to (debug);
text_receiver.listen_to (info); text_receiver.listen_to (info);
text_receiver.listen_to (fatal);
text_receiver.listen_to (warning); text_receiver.listen_to (warning);
text_receiver.listen_to (error);
text_receiver.listen_to (fatal);
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
if (g_getenv ("BOOST_DEBUG")) { if (g_getenv ("BOOST_DEBUG")) {

View File

@ -66,15 +66,18 @@ LogReceiver::receive (Transmitter::Channel chn, const char * str)
const char *prefix = ""; const char *prefix = "";
switch (chn) { switch (chn) {
case Transmitter::Error: case Transmitter::Debug:
prefix = "[ERROR]: "; /* ignore */
break; return;
case Transmitter::Info: case Transmitter::Info:
prefix = "[INFO]: "; prefix = "[INFO]: ";
break; break;
case Transmitter::Warning: case Transmitter::Warning:
prefix = "[WARNING]: "; prefix = "[WARNING]: ";
break; break;
case Transmitter::Error:
prefix = "[ERROR]: ";
break;
case Transmitter::Fatal: case Transmitter::Fatal:
prefix = "[FATAL]: "; prefix = "[FATAL]: ";
break; break;
@ -275,10 +278,10 @@ int main (int argc, char **argv)
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
log_receiver.listen_to (error);
log_receiver.listen_to (info); log_receiver.listen_to (info);
log_receiver.listen_to (fatal);
log_receiver.listen_to (warning); log_receiver.listen_to (warning);
log_receiver.listen_to (error);
log_receiver.listen_to (fatal);
setup_gtk_ardour_enums (); setup_gtk_ardour_enums ();