Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.out, System.err : often temporary debugging statements warning

While writing a very simple multi-platform console application in Netbeans, I have noticed a consistent warning at the statements System.out.println() and System.err.println(), which states these are often temporary debugging statements.

And in details on Netbeans wiki here, it states

These are often temporary debugging statements, and should probably be either removed from production code, or replaced by a more robust logging facility.

Why is it like this and what should I be using then to print out messages to the user strictly in console application viewpoint.

I am using several of these statements to inform user like, the argument is not valid, or some access denied exception occurred, etc.

Any suggestions would help.

like image 617
Indigo Avatar asked Dec 30 '25 08:12

Indigo


1 Answers

If your application will be updated and/or will become a part of another more complex system, these System.out and System.err calls will become less convenient than a properly implemented logging subsystem in your application.

And it will be necessary to rewrite these parts of code to provide the more consistent logging picture for an administrator/end-user.