ClickHouse/src/Client/InternalTextLogs.h

31 lines
526 B
C++
Raw Normal View History

#pragma once
#include <IO/WriteBuffer.h>
2021-10-14 10:25:43 +00:00
#include <Core/Block.h>
namespace DB
{
/// Prints internal server logs
/// Input blocks have to have the same structure as SystemLogsQueue::getSampleBlock()
2021-04-13 20:04:13 +00:00
/// NOTE: IRowOutputFormat does not suite well for this case
2021-10-08 14:03:54 +00:00
class InternalTextLogs
{
public:
2021-10-08 14:03:54 +00:00
InternalTextLogs(WriteBuffer & buf_out, bool color_) : wb(buf_out), color(color_) {}
2021-10-08 14:03:54 +00:00
void write(const Block & block);
2021-10-08 14:03:54 +00:00
void flush()
{
wb.next();
}
private:
WriteBuffer & wb;
bool color;
};
}