linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] liblinphone java exeception handling in call backs


From: Ben Sartor
Subject: [Linphone-developers] liblinphone java exeception handling in call backs
Date: Wed, 27 May 2015 16:48:17 +0200
User-agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

Hi,

I'm having trouble seeing java exceptions in the log file when they are thrown 
in a linphone callback. This code snippet should help, to explain what I mean:

@Override
public void callState(LinphoneCore lc, LinphoneCall call, 
                      LinphoneCall.State state, String message)
{
    final LinphoneCallStats stats = call.getAudioStats();
    Log.i("bandwidth: down=", stats.getDownloadBandwidth(), 
          " up=", stats.getUploadBandwidth());
    // ...
}

If getAudioStats() returns null, a NullPointerException will be thrown and the 
execution aborts. If you have liblinphone's debug logging enabled, you will 
see s.th. like this in your log:

E DEBUG   : Listener 0x100c6e raised an exception

Without having liblinphone's debug logging enabled, nothing is logged. Which 
makes it hard to debug for android developers.

Attached are some patches which add a java backtrace of the exception to the 
log even if liblinphones debug logging is not enabled.

What do think? Would it be possible to merge the patches?

Kind regards,
 Ben Sartor

-- 
———————————————————
https://www.simlar.org
free and secure calls

fon: +49-(0)221-999 999 30
fax: +49-(0)221-999 999 31                                   
mail: address@hidden

github: https://github.com/simlar/
———————————————————

Attachment: 0001-unified-java-exception-handling-in-callbacks.patch
Description: Text Data

Attachment: 0002-fixed-crash-when-java-sets-log-handler-and-an-except.patch
Description: Text Data

Attachment: 0003-java-exception-handling-in-callbacks-now-logs-backtr.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]