hotspot/src/share/vm/utilities/ostream.hpp
changeset 33097 96e348cb0442
parent 29697 92501504191b
child 33107 77bf0d2069a3
--- a/hotspot/src/share/vm/utilities/ostream.hpp	Wed Sep 23 22:04:23 2015 +0300
+++ b/hotspot/src/share/vm/utilities/ostream.hpp	Thu Sep 24 12:36:04 2015 +0200
@@ -235,6 +235,18 @@
   void flush() {};
 };
 
+class logStream : public outputStream {
+private:
+  stringStream _current_line;
+  void (*_log_func)(const char* fmt, ...);
+public:
+  void write(const char* s, size_t len);
+  logStream(void (*log_func)(const char* fmt, ...)) : _log_func(log_func) {}
+  ~logStream() {
+    guarantee(_current_line.size() == 0, "Buffer not flushed. Missing call to print_cr()?");
+  }
+};
+
 class gcLogFileStream : public fileStream {
  protected:
   const char*  _file_name;