Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320266

☂ Examine uses of System.out and System.err in JavaFX runtime

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P4
    • tbd
    • None
    • javafx

    Description

      A library like JavaFX should not print to System.out (unless there is a utility method that is documented to do so).

      We should also reduce or eliminate most printing to System.err where feasible.

      This is an umbrella task to examine our uses of System.out and System.err and file new linked blocking bugs to address them.

      Generally, the use of printing to System.out/err fall into one of three general buckets:

      1. Informational messages printed in certain cases

      2. Warnings or errors printed when something unexpected (often an exception) is encountered

      3. Debug / verbose messages enabled by a System property or environment variable

      There is an internal com.sun.javafx.logging.PlatformLogger helper class, based on System.Logger, that we can use for logging. In general, logging is preferred to printing directly to System.out and System.err.

      The first category is probably the most important one to eliminate. Printing to System.out and System.err for informational purposes should be removed or else replaced with logging at a level that isn't shown by default (e.g., INFO or lower).

      The second category would be nice to replace with logging, at a SEVERE or WARNING level such that they are seen by default. As a first pass, we should replace all references to System.out with System.err.

      The third category isn't important, since the messages are only ever seen when a developer is deliberately looking for them. The only thing we might do for the messages in this group is to replace all references to System.out with System.err. Worth noting is that some of the env variables are processed by native code which similarly prints to stderr.

      Attachments

        Activity

          People

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: