NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

enclose occurence of LOGGER.log with if(LOGGER.isLoggable(Level.INFO)){.. automatically

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
itreppert



Joined: 23 Dec 2008
Posts: 45

PostPosted: Wed Apr 25, 2012 11:24 pm    Post subject: enclose occurence of LOGGER.log with if(LOGGER.isLoggable(Level.INFO)){.. automatically Reply with quote

Hi guys,

is there a way to
enclose every occurence of
Code:
LOGGER.log(....

with
Code:
if(LOGGER.isLoggable(Level.INFO)){..


automatically ?

Regards,
Holger
Back to top
itreppert



Joined: 23 Dec 2008
Posts: 45

PostPosted: Thu Apr 26, 2012 12:32 am    Post subject: Solution found Reply with quote

Find and Replace as Regex

(LOGGER.log\(Level.(.*), ".*) <---Find
if(LOGGER.isLoggable(Level.$2)){$0} <--- replace with

(LOGGER.info.*)
if(LOGGER.isLoggable(Level.INFO)){$0}

(LOGGER.exiting.*)
if(LOGGER.isLoggable(Level.FINER)){$0}

(LOGGER.entering.*)
if(LOGGER.isLoggable(Level.FINER)){$0}

But be careful not to run this twice Wink

Regards,
Holger
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo