I know this question is a bit peripheral, but I'm a bit confused, because I really don't know whether to use parentheses in method call logp or not.
I usually use this:
LOGGER.logp(WARNING, "MyClass", "myMethod()", "Error while ...");
I know this question is a bit peripheral, but I'm a bit confused, because I really don't know whether to use parentheses in method call logp or not.
I usually use this:
LOGGER.logp(WARNING, "MyClass", "myMethod()", "Error while ...");
It is not necessary, if you need for your understanding you can use ()
mostly we dont.
Even if you use log.warning("warning message");
this will log method name and class name. If you need more formatting additionally, you can add Formatter to the log handler.
I would say as you wish but in my opinion brackets unambiguously indicate method name. When you will need to search through dozens of messages it can help you to find for example logging from method with name myMethod()
. Also if it has strange name like noun that can be used to call classes also.