I am working with a piece of code that I find kinda strange. The code I am working on is part of an import utility that takes a CSV file and imports the data into the database.
Inside the code, I see:
ImportUtils.printf("Validation started");
When I look into this method, it is simply calling System.out.println:
public static void printf(String s) {
System.out.println(s);
}
Is there any advantage to this? Could this pose an issue down the road?
Instead of creating a simple System.out.println wrapper consider switching to a full logging API. There are many available ( Commons Logging, Log4j, SLF4J, and many more). These can easily be configured as simple wrappers around the console that are useful for initial development. Down the road these can be modified to write to files, send emails, write to database, … These also provide contextual information ( like which class is generating the logs ) that is very useful and a pain to put in on your own.