On 21/03/2017 19:03, Gregg Wonderly wrote:
Better yet, why aren’t the java.util.logging apis used for stuff like this? It
seems strange that there is not a nice compact formatter, yet, standard in the
JDK. The logging APIs seem highly neglected given that even the varargs access
has not been fixed so that you can use varargs without an array argument on the
end.
Would be nice to see things like this that actually could greatly unify the
management of the runtime environment get used, instead of using stderr and
then creating that as a legacy interface which will now have to work forever
since people will create tooling to use that. If instead logging was used, it
could be quenched with Level settings, or reformatted/managed with a custom
handler so that everyone could have their cake and eat it too…
The java.util.logging API is not appropriate here. There are many
reasons. One is that java.logging is its own module, you can't directly
use it in the java.base module. We can create run-time images that don't
include the java.logging module too. Then there is the issue that using
logging APIs can potentially run arbitrary code and that arbitrary code
will trigger access checks too.
On your comment about neglect then you might want to look at JEP 264 [1].
-Alan
[1] http://openjdk.java.net/jeps/264