Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Retired
Posts: 20
Registered: ‎10-27-2010
My Device: Bold 9800

Re: File based Logging in playbook

Sorry, typo on my part.

 

That should be:

QFile file("./logs/mylog.txt")

 

Not:

QFile file(".logs/mylog.txt")

BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: File based Logging in playbook

There was a typo. It is ./logs (or just logs/...)

I.e. "logs/my.log"

Contributor
Posts: 18
Registered: ‎02-10-2012
My Device: playbook
My Carrier: Airtel

Re: File based Logging in playbook

[ Edited ]

Thanks david..

 

I have given QFile file("logs/mylog.txt");

if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
         return 0;
     QTextStream out(&file);
     out << "The magic number is: " << 49 << "\n";

  file.flush();
    file.close();

Now how can i actually navigate to the file(mylog.txt) in my playbook or in PC connected via usb.

Contributor
Posts: 40
Registered: ‎01-15-2012
My Device: Playbook Tablet
My Carrier: MTS

Re: File based Logging in playbook

[ Edited ]

PC: via usb/wifi: from Momentics IDE: Select QNX system perspecive > Target File System Navigator > Sandboxes> name of YourApllication (something like com.example.QtApp.someMoreChars)>logs>mylog.txt

and it's not accessible via ordinary mount to PC (via smb protocol)

from playbook - as I know - from your apllication only (i.e. read back your log file).

 

upd: from PC from cmd-line also possible to use blackberry-deploy -getFile 

/rgds
Andrey Yaromenok aka azazello
Contributor
Posts: 18
Registered: ‎02-10-2012
My Device: playbook
My Carrier: Airtel

Re: File based Logging in playbook

Many Thanks andrey and david.... I got everything clear

 

 

 

 

 

Regards,

Madhan

Highlighted
Developer
Posts: 62
Registered: ‎03-31-2012
My Device: Playbook
My Carrier: None

Re: File based Logging in playbook

[ Edited ]

I also tried to create a new directory in /accounts/1000/shared which failed. But creating a directory under /accounts/1000/shared/misc worked and I could create many subdirs and files there and access them from Desktop :-)

 

And the Webbrowser on the Playbook will be your friend by accessing file:///