It looks like this could lead to a lot of massive enum dotted around the code.
This is not the first time that someone has wanted to separate a journal message from a journal operator.
In fact, java.util.logging already has a structure for this that is intended for localization.
It uses a .properties file that contains messages.
You get a registrar indicating the file path in the class path: -
Logger logger = Logger.getLogger("com.example", "path/to/messages.properties");
Registration applications are then executed using property keys
logger.log(level, "messageKey");
And you can parameterize the log because it uses MessageFormat syntax
zip.fileDoesNotExist={0} does not exist logger.log(level, "zip.fileDoesNotExist", file);
These options are extremely flexible as you can specify formatting information in them and even use ChoiceFormat if necessary.
The main advantage of all this is that your messages are in a separate file, not a class . And you can enable and disable logging using the logging.properties file. You can even enable or disable logging for individual classes. And you can connect to several files to the console, you can send error messages, etc. etc.
So in conclusion. Use the existing logging structure. Do not roll.
Disclaimer: I am only talking about JUL, because then it is built into Java - you do not need any third-party libraries, there are many, many other frameworks.
Boris the Spider
source share