2

call it crazy, but I never use debugging, just logging when developing software for mobile phones... So when coming from Symbian to Android platform I was looking for something similar here. After searching for a while I figured out a way of using logs (I need live logs during the devlopment and file with logs, when testers are using the application), and I would like to ask the audience to comment and might be make an interesting suggestions:

I welcome any comments to my approach...

BR

STeN

STeN
  • 6,262
  • 22
  • 80
  • 125
  • There is no need to use grep as logcat supports filtering. http://developer.android.com/guide/developing/tools/adb.htmladb ( IE: logcat MyApp:D ) – stealthcopter Mar 04 '11 at 08:49

2 Answers2

1

As suggested in the comments you need not use grep , logcat supports filtering.

I have never used the log-collector but what I prefer is to write all logs to the SD card and also have an UncaughtExceptionHandler which logs to separate files . Only a few lines of code are required and it can entirely be controlled by a configuration parameter.

Edit : UEH sample : How do I obtain crash-data from my Android application?

Community
  • 1
  • 1
Ravi Vyas
  • 12,212
  • 6
  • 31
  • 47
0

One way could be, you can add java.util.logger in your code. Instead of Log.v, use java.util.logger functionality. This is a powerful logger, which can help you publish the log on to a log file on the sdcard and logcat, both at the same time. You can check this link:-

How to configure java.util.logging.logger in android to use a logging properties file placed on the sdcard?

Community
  • 1
  • 1
Robin
  • 497
  • 5
  • 19