-6

I read the class in android docs but I didn't get what is the purpose of using Log class in our code. I know the various Log methods Like Log.i(), Log.e(), Log.v() etc, but why do we use this class?

  • I've already read this, I that link Log methods are elaborated that why where we use Log.e(), Log.i(), etc but the purpose of using this is not mentioned. – Zeeshan Khalid Jan 23 '15 at 08:50
  • I'm reopening this. He's not asking what those functions mean, but why to use logging at all. A bad question to have to be asking, but a different one. – Gabe Sechan Jan 23 '15 at 08:51
  • you should also read the answers, nobody has commented on why these Logs are used :-/ – Zeeshan Khalid Jan 23 '15 at 08:56

2 Answers2

1

To write data to the Android log file for debugging. You might put a log statement in a rare corner case to output a message so you know it happened. Or you may put a lot of log cases in the code so you can debug an issue without stepping through in a debugger.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
0

I will just give a link from another StackExchange network site :

Logging : Why and What

A clean and clear part :

There are two reasons logging is performed:

  • Diagnostic
  • Audit

You should read all the answers to have more details.

Community
  • 1
  • 1
mithrop
  • 3,283
  • 2
  • 21
  • 40