Philipp Hancke | cc40d82 | 2020-10-21 14:09:24 | [diff] [blame] | 1 | Native logs are often valuable in order to debug issues that can't be easily |
| 2 | reproduced. Following are instructions for gathering logs on various platforms. |
| 3 | |
| 4 | To enable native logs for a native application, you can either: |
| 5 | |
| 6 | * Use a debug build of WebRTC (a build where `NDEBUG` is not defined), |
| 7 | which will enable `INFO` logging by default. |
| 8 | |
| 9 | * Call `rtc::LogMessage::LogToDebug(rtc::LS_INFO)` within your application. |
| 10 | Or use `LS_VERBOSE` to enable `VERBOSE` logging. |
| 11 | |
| 12 | For the location of the log output on different platforms, see below. |
| 13 | |
| 14 | #### Android |
| 15 | |
| 16 | Logged to Android system log. Can be obtained using: |
| 17 | |
| 18 | ~~~~ bash |
| 19 | adb logcat -s "libjingle" |
| 20 | ~~~~ |
| 21 | |
| 22 | To enable the logging in a non-debug build from Java code, use |
| 23 | `Logging.enableLogToDebugOutput(Logging.Severity.LS_INFO)`. |
| 24 | |
| 25 | #### iOS |
| 26 | |
| 27 | Only logged to `stderr` by default. To log to a file, use `RTCFileLogger`. |
| 28 | |
| 29 | #### Mac |
| 30 | |
| 31 | For debug builds of WebRTC (builds where `NDEBUG` is not defined), logs to |
| 32 | `stderr`. To do this for release builds as well, set a boolean preference named |
| 33 | 'logToStderr' to `true` for your application. Or, use `RTCFileLogger` to log to |
| 34 | a file. |
| 35 | |
| 36 | #### Windows |
| 37 | |
| 38 | Logs to the debugger and `stderr`. |
| 39 | |
| 40 | #### Linux/Other Platforms |
| 41 | |
| 42 | Logs to `stderr`. |