< prev index next >
src/share/vm/utilities/ostream.hpp
Print this page
rev 8932 : 8046148
@@ -233,10 +233,22 @@
int fd() const { return _fd; }
virtual void write(const char* c, size_t len);
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;
jlong _bytes_written;
uintx _cur_file_num; // current logfile rotation number, from 0 to NumberOfGCLogFiles-1
< prev index next >