2018-06-06 20:57:07 +00:00
|
|
|
#pragma once
|
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
#include <IO/WriteBuffer.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Prints internal server logs
|
|
|
|
/// Input blocks have to have the same structure as SystemLogsQueue::getSampleBlock()
|
|
|
|
/// NOTE: IRowOutputStream does not suite well for this case
|
2018-06-15 17:32:35 +00:00
|
|
|
class InternalTextLogsRowOutputStream : public IBlockOutputStream
|
2018-06-06 20:57:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-02-21 20:01:38 +00:00
|
|
|
InternalTextLogsRowOutputStream(WriteBuffer & buf_out, bool color_) : wb(buf_out), color(color_) {}
|
2018-06-06 20:57:07 +00:00
|
|
|
|
|
|
|
Block getHeader() const override;
|
|
|
|
|
|
|
|
void write(const Block & block) override;
|
|
|
|
|
|
|
|
void flush() override
|
|
|
|
{
|
|
|
|
wb.next();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
WriteBuffer & wb;
|
2020-02-21 20:01:38 +00:00
|
|
|
bool color;
|
2018-06-06 20:57:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|