Brief introduction:

MobilecamSDK currently contains four independent log control classes, which are used to control the log output of different modules.
1. ICatchCameraLog: Use to control the log of the module named “PancamSDK”
2. ICatchPancamLog: Use to control the log of the module named “[Control/Camera]SDK”
3. ICatchUsbTransportLog: Use to control the log of the module named “UsbTransportSDK”
4. ICatchDepthNetTransportLog: Use to control the log of the module named “DepthNetTransportSDK”

The API references:

Among the SDKs of the two programming languages we provide, the ‘C++ SDK’ and the ‘Java SDK’ differ only in the language itself. The API name and return value are almost the same (that is, the class name and method signature are the same).
For example, if I want to open ControlSDK debug mode.
We do this in android/java environment as below:

  1. ICatchCameraLog.getInstance().setDebugMode(true);

We do this in ios/c++ environment as below:

  1. ICatchCameraLog::getInstance()->setDebugMode(true);

Let us use java api as an template to introduce
Class:

  1. ICatchPancamLog
  2. ICatchCameraLog
  3. ICatchUsbTransportLog
  4. ICatchDepthNetTransportLog

Method:

  1. public void setSystemLogOutput(bool bOutput)_ _set _w_hether to write the log to the console or not, on the Android platform, it will be written to ddms, on ios and other platforms it will be written to standard output.
  2. public void setFileLogPath(String path)_ _Set the path where to store the log file.
  3. public void setFileLogOutput(bool bOutput) set whether to write the log to the file. if you do not specify a path before call this API, the log file will be saved at “./“ on unix-like system, ‘/mnt/sdcard/‘ on android os, but on ios, you must specify the log path.
  4. public void setDebugMode(boolean debugMode) set whether to enable debug mode or not.
  5. public void setLog(int type, bool enable) To enable a specified log type.
  6. public void setLogLevel(int type, int level) To set log level ot a specified type.

**

Some examples:

1. Output all the log infomations of the ControSDK’s, in the development stage or just for debug.
  1. private void initCameraLog(String path) {
  2. ICatchCameraLog.getInstance().setDebugMode(true);
  3. ICatchCameraLog.getInstance().setFileLogPath(path);
  4. ICatchCameraLog.getInstance().setFileLogOutput(true);
  5. ICatchCameraLog.getInstance().setSystemLogOutput(true);
  6. ICatchCameraLog.getInstance().setLog(ICatchCamLogType.ICH_CAM_LOG_TYPE_COMMON, true);
  7. ICatchCameraLog.getInstance().setLogLevel(ICatchCamLogType.ICH_CAM_LOG_TYPE_COMMON, ICatchCamLogLevel.ICH_CAM_LOG_LEVEL_INFO);
  8. ICatchCameraLog.getInstance().setLog(ICatchCamLogType.ICH_CAM_LOG_TYPE_THIRDLIB, true);
  9. ICatchCameraLog.getInstance().setLogLevel(ICatchCamLogType.ICH_CAM_LOG_TYPE_THIRDLIB, ICatchCamLogLevel.ICH_CAM_LOG_LEVEL_DEBUG);
  10. }

2. Output all the log infomations of the ControS’s, in the development stage or just for debug.
  1. private void initPancamLog(String path){
  2. ICatchPancamLog.getInstance().setDebugMode(true);
  3. ICatchPancamLog.getInstance().setFileLogPath(path);
  4. ICatchPancamLog.getInstance().setSystemLogOutput(true);
  5. ICatchPancamLog.getInstance().setFileLogOutput(true);
  6. ICatchPancamLog.getInstance().setLog(ICatchGLLogType.ICH_GL_LOG_TYPE_COMMON, true);
  7. ICatchPancamLog.getInstance().setLogLevel(ICatchGLLogType.ICH_GL_LOG_TYPE_COMMON, ICatchGLLogLevel.ICH_GL_LOG_LEVEL_INFO);
  8. ICatchPancamLog.getInstance().setLog(ICatchGLLogType.ICH_GL_LOG_TYPE_DEVELOP, true);
  9. ICatchPancamLog.getInstance().setLogLevel(ICatchGLLogType.ICH_GL_LOG_TYPE_DEVELOP, ICatchGLLogLevel.ICH_GL_LOG_LEVEL_INFO);
  10. ICatchPancamLog.getInstance().setLog(ICatchGLLogType.ICH_GL_LOG_TYPE_OPENGL, true);
  11. ICatchPancamLog.getInstance().setLogLevel(ICatchGLLogType.ICH_GL_LOG_TYPE_OPENGL, ICatchGLLogLevel.ICH_GL_LOG_LEVEL_INFO);
  12. ICatchPancamLog.getInstance().setLog(ICatchGLLogType.ICH_GL_LOG_TYPE_STREAM, true);
  13. ICatchPancamLog.getInstance().setLogLevel(ICatchGLLogType.ICH_GL_LOG_TYPE_STREAM, ICatchGLLogLevel.ICH_GL_LOG_LEVEL_INFO);
  14. }

3. Output all the log infomations of the UsbTransport, in the development stage or just for debug.
  1. private void initUsbTransportLog(String path) {
  2. ICatchUsbTransportLog.getInstance().setFileLogPath(path);
  3. ICatchUsbTransportLog.getInstance().setDebugMode(false);
  4. ICatchUsbTransportLog.getInstance().setFileLogOutput(true);
  5. ICatchUsbTransportLog.getInstance().setSystemLogOutput(true);
  6. }

4. Output all the log infomations of the DepthNetTransport, in the development stage or just for debug.
  1. private void initDepthNetTransportLog(String path) {
  2. ICatchDepthNetTransportLog.getInstance().setFileLogPath(path);
  3. ICatchDepthNetTransportLog.getInstance().setDebugMode(false);
  4. ICatchDepthNetTransportLog.getInstance().setFileLogOutput(true);
  5. ICatchDepthNetTransportLog.getInstance().setSystemLogOutput(true);
  6. }

Important Tips:

When releasing the official version of the App, if you need to close Log (for better performance), just do as follows, to close all module’s log output:

  1. OneOfTheLogClass.getInstance().setDebugMode(false); // Set the debugmode to false
  2. OneOfTheLogClass.getInstance().setSystemLogOutput(false); // close the system log output
  3. OneOfTheLogClass.getInstance().setFileLogOutput(false); // close the file log output

In special situations, if you do not want to turn off log output (expecting to obtain log files), you should set the debugging mode to false and turn off the system log output.