Re: [android-developers] Re: Transitioning from debug to release builds
You can also try proxying the logger class into your own, and in your implementation comment out the debug functions. The calls will simply be optimized away (even without JIT, Dalvik will remove these..) kris On Tue, Mar 27, 2012 at 8:31 PM, RedBullet scottedchap...@gmail.com wrote: I guess I don't understand what the documentation means when it says Debug logs are compiled in but stripped at runtime it implies there is some processing that takes place. If the answer is that the developer should comment out or otherwise remove Verbose/Debug log statements it seems like it should just say so? On Tuesday, March 27, 2012 12:45:15 PM UTC-4, Chris Pearson wrote: Creating a release build doesn't remove the Log messages. It would be nice to be able to disable them automatically that way, though. On Mar 27, 8:22 am, RedBullet scottedchap...@gmail.com wrote: In my app I have Warning, Debug, Information, and Verbose logging. They ALL see to get logged whether I am running, debugging, or running on the device (exported the app from eclipse and installed/run on my phone). On Tuesday, March 27, 2012 10:59:57 AM UTC-4, lbendlin wrote: if you are not yet ready to post to the market, you can also simply use Run rather than Debug in Eclipse. On Tuesday, March 27, 2012 10:55:26 AM UTC-4, MagouyaWare wrote: Export a signed .apk from eclipse... On Mar 27, 2012 6:47 AM, RedBullet wrote: I am in the process of building my first app using Eclipse, and am preparing to start doing release builds. For example I am going through to make sure I have the right logging level for my log statements. But I do not really see how to produce a release build. For example in the documentation for Log ( http://developer.android.com/reference/android/util/Log.html) it says: Verbose should never be compiled into an application except during development. Debug logs are compiled in but stripped at runtime. Error, warning and info logs are always kept. It isn't clear to me how *I* do that or if that is done on my behalf when a release build is done... And to the last point there, I don't see where I actually do a release build... Thanks in advance! -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Transitioning from debug to release builds
On Wed, Mar 28, 2012 at 10:13 AM, Kristopher Micinski krismicin...@gmail.com wrote: You can also try proxying the logger class into your own, and in your implementation comment out the debug functions. The calls will simply be optimized away (even without JIT, Dalvik will remove these..) With ADT17 is as easy as: if (BuildConfig.DEBUG) { Log.d(TAG, foobar); } BuildConfig.DEBUG will be set to false when exporting a signed up, thus log statement will be removed from the release build. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Transitioning from debug to release builds
Right, but my point is that you can even do this without the ifs, as you probably don't want to put them all over your code, and a null method body will get optimized away. kris On Tue, Mar 27, 2012 at 9:19 PM, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Wed, Mar 28, 2012 at 10:13 AM, Kristopher Micinski krismicin...@gmail.com wrote: You can also try proxying the logger class into your own, and in your implementation comment out the debug functions. The calls will simply be optimized away (even without JIT, Dalvik will remove these..) With ADT17 is as easy as: if (BuildConfig.DEBUG) { Log.d(TAG, foobar); } BuildConfig.DEBUG will be set to false when exporting a signed up, thus log statement will be removed from the release build. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Transitioning from debug to release builds
Can you explain how I would proxy it? On Tuesday, March 27, 2012 9:22:07 PM UTC-4, Kristopher Micinski wrote: Right, but my point is that you can even do this without the ifs, as you probably don't want to put them all over your code, and a null method body will get optimized away. kris On Tue, Mar 27, 2012 at 9:19 PM, Nikolay Elenkov wrote: On Wed, Mar 28, 2012 at 10:13 AM, Kristopher Micinski wrote: You can also try proxying the logger class into your own, and in your implementation comment out the debug functions. The calls will simply be optimized away (even without JIT, Dalvik will remove these..) With ADT17 is as easy as: if (BuildConfig.DEBUG) { Log.d(TAG, foobar); } BuildConfig.DEBUG will be set to false when exporting a signed up, thus log statement will be removed from the release build. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Transitioning from debug to release builds
On Wed, Mar 28, 2012 at 10:22 AM, Kristopher Micinski krismicin...@gmail.com wrote: Right, but my point is that you can even do this without the ifs, as you probably don't want to put them all over your code, and a null method body will get optimized away. This could in the proxy, yes. My point is that with AD17 you don't have to comment/set a flag manually, Eclipse does it for you. It will still be optimized away when DEBUG is false. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Transitioning from debug to release builds
Right, so either way is your preference. kris On Tue, Mar 27, 2012 at 9:31 PM, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Wed, Mar 28, 2012 at 10:22 AM, Kristopher Micinski krismicin...@gmail.com wrote: Right, but my point is that you can even do this without the ifs, as you probably don't want to put them all over your code, and a null method body will get optimized away. This could in the proxy, yes. My point is that with AD17 you don't have to comment/set a flag manually, Eclipse does it for you. It will still be optimized away when DEBUG is false. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en