Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

need a mechanism for turning ON/OFF  SOPs

Thread view: 
peczcyberworld - 21 Apr 2007 02:52 GMT
hi all,

please help me in finding a solution::: the scenario is I have some 20
classes and each has 2 methods and those methods has
System.out.println(" some text "). i need a mechanism to turn ON/ OFF
the SOPs to be printed in the console.
I have two possible ways
1.  using javaw instead of java which will bypass the console.
2.  using an if condition
for eg:

class A
{
boolean a = false;
if(false)
{
System.out.println("some text");
}
}

but I need to have this IF condition check at each n every method is
there any possibility that I can  have only one check that can turn
ON /OFF the SOPs
or please help me with other alternatives.

thanks in advance

}
Arne Vajhøj - 21 Apr 2007 02:57 GMT
> please help me in finding a solution::: the scenario is I have some 20
> classes and each has 2 methods and those methods has
[quoted text clipped - 18 lines]
> ON /OFF the SOPs
>  or please help me with other alternatives.

Look at either java.util.logging or log4j !

Arne
Lew - 21 Apr 2007 04:26 GMT
peczcyberworld wrote:
>> class A
>> {
[quoted text clipped - 9 lines]
>> ON /OFF the SOPs
>>  or please help me with other alternatives.

> Look at either java.util.logging or log4j !

And perhaps apache commons-logging in conjunction with either of those.

Signature

Lew

Knute Johnson - 21 Apr 2007 04:13 GMT
> hi all,
>
[quoted text clipped - 24 lines]
>
> }

System.setOut(new PrintStream("nul));  // windows
System.setOut(new PrintStream("/dev/nul"));  // linux

Signature

Knute Johnson
email s/nospam/knute/

Z. - 21 Apr 2007 05:05 GMT
> but I need to have this IF condition check at each n every method is
> there any possibility that I can  have only one check that can turn
> ON /OFF the SOPs
>  or please help me with other alternatives.

See System.setOut();


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.