Skip to main content

Log class under Eclipse

2 replies [Last post]
digitalsol
Offline
Joined: 2009-10-11

Hello,
I'm using Eclipse here for LWUIT development. I'm thinking of using this class
https://lwuit.dev.java.net/nonav/javadocs/index.html for logging purposes.
But in the description it says :

Pluggable logging framework that allows a developer to log into storage using the file connector API. It is highly recommended to use this class coupled with Netbeans preprocessing tags to reduce its overhead completely in runtime.

Is it a big issue that I'm not using Netbeans in this case ?

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

The best I can suggest is to have a public static final variable and surround all log calls with if()... Then hope the obfuscator actually removes them.

Mixa

You can tell proguard to strip unwanted methods while optimizing - use
assumenosideeffects keyword:
-assumenosideeffects public class java.lang.Throwable{ public void
printStackTrace(); }
-assumenosideeffects public class com.sun.lwuit.util.Log{ protected
void print(...); }

It tells the obfuscator that LWUIT Log.print() doesn't do anything
useful, and since the method doesn't have return a value, all calls of
it will be removed. It in turn makes Log.p() useless, and strips them
as well.

I can check in result map file if the methods were actually removed.

In production build I just use production proguard conf file.

Regards,
Mike

On Thu, Mar 4, 2010 at 6:08 PM, wrote:
> The best I can suggest is to have a public static final variable and surround all log calls with if()... Then hope the obfuscator actually removes them.
> [Message sent by forum member 'vprise' (shai@vprise.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=390072
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net