September 24, 2018, 09:58:14 AM

Author Topic: How does logging done in Android Programming?  (Read 556 times)


  • Guest
How does logging done in Android Programming?
« on: October 11, 2013, 10:50:40 PM »
Is it supported in Android? Can you tell me the code to use for logging?

I am going on with creating a simple project in Android but sometimes in middle I use to get stuck up totally, so can you tell me how to use logging in Android Programming?

Can you also give me the code of how to use logging feature in Android?

Offline infomaniac

  • Administrator
  • Full Member
  • *****
  • Thank You
  • -Given:
  • -Receive:
  • Posts: 173
  • Karma: +0/-0
    • View Profile
    • Poke This Member
Re: How does logging done in Android Programming?
« Reply #1 on: October 11, 2013, 10:52:14 PM »
Logging is one of the best way to learn in any Programming languages and as like any other programming language Android Programming do support logging as well which offers a system-wide capability.

Now in order to log your activities, the code to follow is

Log.d(TAG, message)

TAG and message are the strings where TAG is nothing but your name of the app and as good practice the best way to carry on is to define a Java constant for the entire class as given below,

private static final String TAG = “CheckingtheStatus”;

And one more thing to note is that the logging as different severity levels which are,

.d() - Debug level
.e() - Error level
.w() - Warning level
.i() - Info level
.wtf() - Errors which should not happen (stands for What a Terrible Failure)

One more important thing to note about is that Log messages are color-coded based on the
severity level.

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
Copyrights © InfoManiac

Related Posts Plugin for WordPress, Blogger...