Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Testing and Debugging The Android Log

i just cant get it. why do we need logs?

Please help me.

1 Answer

Hello,

One reason we want to be able to write things to the log is so that we can test and troubleshoot our apps. It gives us a location to print information that a user won't see unless they try to access it. Its also a lot cleaner for dumping data if we need to diagnose a problem. Unlike dialogs and toast messages, you can access a lot more data at once with logcat so it is an ideal place to output exception messages and other errors. Another handy indirect feature of logging with logcat is that you can save that to a file so you can analyze it at your convience.