I want to use wtf_is_fatal==1 as the gate for my expensive asserts since
the people who will set wtf_is_fatal (the dev team) will also be ok with
the slight slowdown caused by expensive asserts. Strictly speaking, these
should be two independent settings, but I was hoping to piggyback off of
wtf_is_fatal==1 so the devs do not have to worry about setting two
different bits. If I can not access wtf_is_fatal, I will probably add a
separate property.

On Fri, Aug 10, 2012 at 11:32 AM, Dianne Hackborn <[email protected]>wrote:

> Why do you want to do this?  If you want to log an error that doesn't
> cause your app to crash, use Log.w().  I generally recommend if you have a
> fatal error, using Log.e() (though it is your responsibility to crash or
> whatever the fatal error behavior is after that).
>
> If you don't want the behavior of Log.wtf() (which is partly that it can
> optional crash your app based on the setting), then don't use it.  The only
> reason to use it that I can think of is because you want the behavior it
> provides.  Is there some other reason you want to call that specific method?
>
>
> On Fri, Aug 10, 2012 at 11:13 AM, Shri <[email protected]> wrote:
>
>> I want to check if Log.wtf will result in program termination. I want to
>> use that property to enable expensive asserts in my program. How can I
>> check for this? I used the following code but it throws
>> SettingNotFoundException.
>>
>>   int wtfIsFatal =
>> android.provider.Settings.Secure.getInt(getContentResolver(),
>> "wtf_is_fatal");
>>
>> I tried adding android.permission.WRITE_SECURE_SETTINGS to my
>> AndroidManifest.xml but that does not help. I had set wtf_is_fatal as such:
>>
>> adb root
>> adb shell
>> sqlite3 /data/data/com.android.providers.settings/databases/settings.db
>> >> insert into secure (name, value) values ('wtf_is_fatal', 1);
>> >> select * from secure;
>> ...
>> 60|wtf_is_fatal|1
>> ...
>>
>> Thanks,
>> Shri
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to