Make printing debug messages runtime configurable (#619)

Supplying --verbose to the fluidsynth executable now prints debug messages to stdout. Debug messages are still being printed by default when fluidsynth was compiled in debug mode.
This commit is contained in:
Tom M 2020-02-13 17:09:20 +01:00 committed by GitHub
parent 2bbe9272bb
commit aa3f5a52fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -706,6 +706,7 @@ int main(int argc, char **argv)
case 'v':
fluid_settings_setint(settings, "synth.verbose", TRUE);
fluid_set_log_function(FLUID_DBG, fluid_default_log_function, NULL);
break;
case 'z':

View file

@ -85,7 +85,11 @@ static fluid_log_function_t fluid_log_function[LAST_LOG_LEVEL] =
fluid_default_log_function,
fluid_default_log_function,
fluid_default_log_function,
#ifdef DEBUG
fluid_default_log_function
#else
NULL
#endif
};
static void *fluid_log_user_data[LAST_LOG_LEVEL] = { NULL };
@ -149,9 +153,7 @@ fluid_default_log_function(int level, const char *message, void *data)
break;
case FLUID_DBG:
#if DEBUG
FLUID_FPRINTF(out, "%s: debug: %s\n", fluid_libname, message);
#endif
break;
default: