Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3981058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:21:53+00:00 2026-05-20T05:21:53+00:00

I have an application that uses a lot of Log.d() or Log.e() calls for

  • 0

I have an application that uses a lot of Log.d() or Log.e() calls for debugging. Now I want to create my final package for release. The Android Export feature from Eclipse mentions to remove the "Debuggable" flag in the manifest, which I have done. Should I also comment all the Log calls to improve the performance of my application or these calls will do nothing in the non debuggable final version package ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:21:54+00:00Added an answer on May 20, 2026 at 5:21 am

    I have subclassed the Log class to a class called Trace, which mirrors methods on Log. So I do Trace.d(TAG,”blah”) and then within the Trace.d method the code only executes based on a static final class variable called LOGGING_LEVEL, which has levels 1-5 (none, errors only, errors & warnings, errors & warnings & info, and everything including debug) . When producing a production APK, Proguard removes all the code that isn’t used in the application, so it does it for me.

    For me, logging is far too important to remove from the source, but it must be removed from the production application, for performance, secure and intellectual property reasons.

    This structure allows me to add a lot MORE logging to the application, which makes debugging problems much easier, but with no impact whatsoever on the production APK

    public class Trace
    {
        public static final int    NONE                         = 0;
        public static final int    ERRORS_ONLY                  = 1;
        public static final int    ERRORS_WARNINGS              = 2;
        public static final int    ERRORS_WARNINGS_INFO         = 3;
        public static final int    ERRORS_WARNINGS_INFO_DEBUG   = 4;
    
        private static final int          LOGGING_LEVEL   = ERRORS_ONLY;        // Errors + warnings + info + debug (default)
    
        public static void e(String tag, String msg)
        {
            if ( LOGGING_LEVEL >=1) Log.e(tag,msg);
        }
    
        public static void e(String tag, String msg, Exception e)
        {
            if ( LOGGING_LEVEL >=1) Log.e(tag,msg,e);
        }
    
        public static void w(String tag, String msg)
        {
            if ( LOGGING_LEVEL >=2) Log.w(tag, msg);
        }
    
        public static void i(String tag, String msg)
        {
            if ( LOGGING_LEVEL >=3) Log.i(tag,msg);
        }
    
        public static void d(String tag, String msg)
        {
            if ( LOGGING_LEVEL >=4) Log.d(tag, msg);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php web application that uses big cookies to store a lot
I have an internal web application, that is IE specific, and uses a lot
I have an application that uses the Paperclip plugin for image upload. Now that
I am trying to create an MSI package that uses the AppCmd application to
I have a server application that uses a lot of threads. Without wanting to
I have an asp.net application that uses a lot of master data like Currencies,
I have an asp.net web forms application that uses linq 2 sql. A lot
I have an Android application that uses a class that extends the Activity class,
I have an application that uses sockets to connect to my server. A lot
I have a demo application that is written in Python. It uses a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.