Suppress Inspections for specific Debug class in Android Studio -


one of developers in team likes leave logs in code constantly. switched using debug class allow switch these flows / batches of messages on , off follows

public class dbg {     public static final boolean log_flow_deeplinks = false;     public static final boolean log_flow_images = true;     public static final boolean log_flow_blogger = false; } 

and used like

if (dbg.log_flow_deeplinks || dbg.log_flow_images ) log.v(tag, ...); 

this because gets compiled out completely, problem android studio highlighting every 1 of usage statements simplification (bool).

we want keep "...can simplified ..." inspections junior developers, amount of things highlighted distracting. there way through annotations (or other means) suppress inspections relating dbg across whole project?

ive looked here wasnt doesn't tell me annotations available

boolean.parseboolean() trick:

public class dbg {     public static final boolean log_flow_deeplinks = boolean.parseboolean("false");     public static final boolean log_flow_images = boolean.parseboolean("true");     public static final boolean log_flow_blogger = boolean.parseboolean("false"); } 

btw: done in automatically generated <yourpackage>.buildconfig.java file "official" way solve warnings


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -