signalapp / ringrtc

GNU Affero General Public License v3.0
550 stars 135 forks source link

Output of LOG Function in .cc file #31

Closed hilmanfitriana19 closed 3 years ago

hilmanfitriana19 commented 3 years ago

hello, in the ringrtc folder I found a lot of native code in the .cc extension which contains functions such as DLOG, RTC_LOG, RTC_DLOG, etc.

What I understand is that all of these functions work as loggers and will issue an info or error or something. This is the same as the info!() command in an .rs file. When the ringrtc project is built as .aar and linked as dependency of the signal-android project, in a file with .rs extension, the info function will display the parameters in the run tab when the project is built. So what I want to ask, where will the output of the DLOG, RTC_LOG, etc. functions in the .cc enhanced file be displayed?

jim-signal commented 3 years ago

Hi @hilmanfitriana19, each platform's client comes with its own logging framework, so both the RingRTC and WebRTC libraries each have their own logging mechanism that is fed to the client. Since I think you are focused on the Android client, the connection between the logging frameworks is made here:

https://github.com/signalapp/ringrtc/blob/master/src/android/api/org/signal/ringrtc/CallManager.java#L88

The client implements a Logger in which they map RingRTC logs to their own using Log.java. WebRTC uses the WebRtcLogger.java which is also set in the CallManager initialize function, however those are too detailed and only shown for debug builds and then only INFO level and above (unless you have your own build and change them).

hilmanfitriana19 commented 3 years ago

Ok thank you again for the answer. It really helped me to get closer to what i want