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

LogStream should autoflush on destruction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • b13

      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.

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

              Created:
              Updated:
              Resolved: