Tuesday, February 26, 2013

BB 10 - Logging in Cpp and QML

We can print logs in BB 10 using Cpp and QML.


  •   LOGS in Cpp
    • Using cout
std::cout << "My First LOG" << std::endl;
    • Using fprintf
fprintf(stdout,"%s\n","My first log");
 fflush(stdout);
 You can view these Logs directly in the console window of eclipse.
  •  LOGS in QML
    • We have two ways to print logs in QML via console.log() or console.debug()
console.log("onClicked called..................");

We can view the logs of QML via Terminal. For more details to launch terminal, refer the point's listed below.

  1. In the IDE, in the Target Navigator view, right-click the device target.
  2. Click Launch SSH Session.
  3. To view real-time output for the processes that are being debugged (for applications that are running in development mode), type slog2info -w.
You can also access the log files directly in the /tmp/slogger22 on the device and run these logs through slog2info at a later time.




No comments:

Post a Comment