[android-developers] Re: Stripping Log._ out of production

2009-10-12 Thread stanlick
Would the Application class be a good place for this? The android.app.Application class The android.app.Application is a base class for those who need to maintain global application state. It can be accessed via getApplication() from any Activity or Service. It has a couple of life- cycle

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread Dan Sherman
I would imagine it does the string concat and then disregards it. It would concat, pass the final string to the function, fail the if, return, and discard the string... - Dan On Fri, Oct 2, 2009 at 9:31 AM, jsdf jasons...@gmail.com wrote: Hi all, I have been using the following conventions

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread Dianne Hackborn
Yeah you will still get the concats, which you really don't want to keep (those are really expensive). We typically write logging like this: if (DEBUG) Log.v(foo, this is something: + something); Then when DEBUG is false the entire statement, including string concatenation, is stripped. On

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread jotobjects
android.util.Config.DEBUG is true if this is a debug build. import static android.util.Config.DEBUG; if (DEBUG) ... On Oct 2, 9:48 am, Dianne Hackborn hack...@android.com wrote: Yeah you will still get the concats, which you really don't want to keep (those are really expensive).  We

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread Dianne Hackborn
android.util.Config.DEBUG is -only- for use by the platform. That probably never have should been in the SDK. (Actually, in either Donut or Eclair these are at least deprecated.) On Fri, Oct 2, 2009 at 11:44 AM, jotobjects jotobje...@gmail.com wrote: android.util.Config.DEBUG is true if this

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread jotobjects
In 1.6 it is deprecated? What is the correct way to detect debug mode? On Oct 2, 11:59 am, Dianne Hackborn hack...@android.com wrote: android.util.Config.DEBUG is -only- for use by the platform.  That probably never have should been in the SDK.  (Actually, in either Donut or Eclair these are

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread fadden
On Oct 2, 12:14 pm, jotobjects jotobje...@gmail.com wrote: In 1.6 it is deprecated? What is the correct way to detect debug mode? This is expected to be used as a compile-time constant within the app framework. You can and should build your app for debug or release as you see fit,

[android-developers] Re: Stripping Log._ out of production

2009-10-02 Thread jotobjects
I think you mean that each app should define some internal constant and recompile for release (and not use the Config constants) ? Is that right? Is there a conventional property or mechanism that the Log class uses for isLoggable() method? The 1.6 release notes (API diff) says that all the