Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
BlackBerry Development Advisor
davidcummings
Posts: 20
Registered: 10-27-2010

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")

Please use plain text.
BlackBerry Development Advisor
elena_laskavaia
Posts: 406
Registered: 10-27-2010

Re: File based Logging in playbook

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

I.e. "logs/my.log"

Please use plain text.
Contributor
madhanbalus
Posts: 18
Registered: 02-10-2012
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.

Please use plain text.
Contributor
azazello
Posts: 36
Registered: 01-15-2012
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
Please use plain text.
Contributor
madhanbalus
Posts: 18
Registered: 02-10-2012
My Carrier: Airtel

Re: File based Logging in playbook

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

 

 

 

 

 

Regards,

Madhan

Please use plain text.
Developer
BikeAtor
Posts: 56
Registered: 03-31-2012
My Carrier: 1&1

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:///

Please use plain text.