BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-29-2010, 07:30 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8800
PIN: N/A
Carrier: abc
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to add logging in BB application using JDE.

Please Login to Remove!

Hi,

I am in need of some info regarding logging in BB application.

I am using BB JDE to develop the apps.
Can anyone pls. let me know how to add logging in a BB application?
If possible pls provide a sample application.

Thanks in advance,
Sreelatha.
Offline  
Old 01-29-2010, 09:39 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Use net.rim.device.api.system.EventLogger, sample code is included in the API documentation.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 02-03-2010, 02:18 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 8800
PIN: N/A
Carrier: Airtel
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sample code:

class Log
{
private static final String APP_Name = "myApp";
private static final long GUID = 0x5ddd3452d88822e2L;


static
{
init();
}

public static void init()
{
EventLogger.register(GUID, APP_Name, EventLogger.VIEWER_STRING);
}

public static void debug(String value)
{
// add check for EventLogger.getMinimumLevel() >= debug level
EventLogger.logEvent(GUID, value.getBytes(), EventLogger.DEBUG_INFO);
}

}

You may now use Log.debug in your application whereever required.
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.