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

Enable construction of LogStreamImpl from LogMessageImpl

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • None
    • hotspot
    • b25

      If a LogStreamImpl can be constructed from a LogMessageImpl, then we get non-interleaving streaming logs and xml logs (because xmlStream can be created from outputStream, which LogStreamImpl is).

      This enables UL to replace two patterns found in the logging framework:

          ttyLocker + (x)tty
          Instead of taking the global tty lock in order to ensure non-interleaving logs we can now make a NonInterleavingLogstream and pass that around to various print_on(outputStream*) functions.

          stringStream + outputStream*
          In order to avoid taking the lock and being able to take arbitrary output streams a stringStream is created and finally printed through print_raw(ss.as_string()). This however requires a ResourceMark, which NonInterleavingLogStream does not require.

            jsjolen Johan Sjölen
            jsjolen Johan Sjölen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: