Thanks For your Reply.I haven't checked global search.I am using Microsoft visual source safe as confiuration management. I cannot global search and replace as i have to checkout each file and then remove System.out.println()'s..Is there any alternative to find System.out.println()'s in the application code...
Thanks In Advance,
Vipul Kumar.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35441
9
posted
0
How do you expect to remove something from the source code without changing the source code?
vipul bondugula
Ranch Hand
Joined: Oct 14, 2010
Posts: 218
posted
0
Actually I don't mean that.
Doesn't the editor have global search & replace?
Your suggestion is good one. I can global search and replace the code if iam not using the configuration management.I cannot replace the code directly.I have to check in each file and then replace.It takes minimum 4-5 days to replace the code.Please suggest me another alternative...
vipul bondugula wrote:Please suggest me another alternative...
It is hard to suggest an alternate! you can write your own program to search and remove the System.out.println() in your source files.
but again you need to test the program in different test cases thoroughly! writing the tedious test case and testing may take 4 or 5 days
I am not really sure understand what you mean here. I am using eclipse and I just searched for logger statements in my code. I got around 1327 hits in a few seconds.
Maneesh Godbole wrote: I am using eclipse and I just searched for logger statements in my code. I got around 1327 hits in a few seconds.
vipul dont have this facility in his work environment!
even in eclipse, searching System.out.println statement and replacing/removing is not that easy, for example
System.out.println("Logged Exception : "+e.getMaessage); you can highlight System.our.println, but what would happen to remaining strings! however you can replace System.out.println with // but still commented part remains in code!
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35441
9
posted
0
Seetharaman Venkatasamy wrote:you can highlight System.our.println, but what would happen to remaining strings! however you can replace System.out.println with // but still commented part remains in code!
That's easy: Regexp search/replace - every decent editor and IDE has it.
Never ascribe to malice that which can be adequately explained by stupidity.
vipul bondugula
Ranch Hand
Joined: Oct 14, 2010
Posts: 218
posted
0
Thanks For Your Replies.
In the global search iam having regular expression option.can anyone provide me search keyword to search System.out.println() statements. Actually i have provided "System.out.println(" but this does not work.Showing Regular Expression Error.
As a lesson for next time, you should probably use a logging framework (e.g. Log4J, SLF4J, etc) instead of using System.out. That way you can increase the logging level (to debug for instance) when testing, and decrease it again (to info / warning) when deploying to production.