Merge pull request #1600 in FS/freeswitch from ~ANDYWOLK/freeswitch:bugfix/FS-11422-fix-logging to master

* commit '3b281cd5a1d2eebf009ea3fb456ee072f70cdb06':
  FS-11422: [mod_java] Fix logging.
This commit is contained in:
Andrey Volk 2018-09-29 10:28:21 +00:00
commit 0bde42affd
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ SWITCH_DECLARE(void) setOriginateStateHandler(jobject stateHandler)
if ( stateHandler != NULL && originate_state_handler != NULL ) {
const char* errorMessage = "Originate state handler is already registered";
jclass exceptionClass = env->FindClass("java/util/TooManyListenersException");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, errorMessage);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s", errorMessage);
env->ThrowNew(exceptionClass, errorMessage);
} else if ( stateHandler == NULL && originate_state_handler != NULL ) {
env->DeleteGlobalRef(originate_state_handler);
@ -24,7 +24,7 @@ SWITCH_DECLARE(void) setOriginateStateHandler(jobject stateHandler)
if ( originate_state_handler == NULL ) {
const char* errorMessage = "Unable to create global reference for state handler";
jclass exceptionClass = env->FindClass("java/lang/OutOfMemoryError");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, errorMessage);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s", errorMessage);
env->ThrowNew(exceptionClass, errorMessage);
}
}