1 | #pragma once |
2 | #include <DataStreams/IBlockOutputStream.h> |
3 | #include <IO/WriteBuffer.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | /// Prints internal server logs |
10 | /// Input blocks have to have the same structure as SystemLogsQueue::getSampleBlock() |
11 | /// NOTE: IRowOutputStream does not suite well for this case |
12 | class InternalTextLogsRowOutputStream : public IBlockOutputStream |
13 | { |
14 | public: |
15 | |
16 | InternalTextLogsRowOutputStream(WriteBuffer & buf_out) : wb(buf_out) {} |
17 | |
18 | Block () const override; |
19 | |
20 | void write(const Block & block) override; |
21 | |
22 | void flush() override |
23 | { |
24 | wb.next(); |
25 | } |
26 | |
27 | private: |
28 | |
29 | WriteBuffer & wb; |
30 | }; |
31 | |
32 | } |
33 | |