I am in a project written in Java somewhat advanced where I have used a lot of messages by console. I would not like to remove them, but not to print them if I do not define it that way in any configuration option of the program (For example, run it in debug mode).
What I want is to direct them to my own "message console" where I can manipulate this information (Show on screen, create logs, etc). Currently I have a function that simulates the structure (A class that calls the console and have named the instance and a role as SystemOut.println()
) but I would like to overwrite System.out.println("")
non modify the code that I have defined and also capture so immediately the exceptions. Is this possible? I am open to recommendations.