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

LogStream should autoflush on destruction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b13

      Description

      LogStream is used to pipe output generated by functions writing to outputStream* into the UL framework. In contrast to other outputStreams, it requires that the output written is terminated with a cr().

      That is because LogStream caches the written characters until cr() and writes then a full line to UL. Hence it requires the user to always write full lines, otherwise it asserts.

      However, that is very inconvenient, since often one just calls a pre-existing xxx->print_on(outputStream*) function, and one does not know if the function terminates with a cr().

      It would be way more convenient were LogStream to write any unfinished output left in its buffer to UL as one last line.

        Attachments

          Activity

            People

            • Assignee:
              stuefe Thomas Stuefe
              Reporter:
              stuefe Thomas Stuefe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: