mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
aee034a597
- Move some code into module part to avoid dependency from IStorage in SystemLog - Remove extra headers from SystemLog.h - Rewrite some code that was relying on headers that was included by SystemLog.h v2: rebase v3: squash move into module part with explicit template instantiation (to make each commit self compilable after rebase)
49 lines
1006 B
C++
49 lines
1006 B
C++
#pragma once
|
|
|
|
#include <Interpreters/SystemLog.h>
|
|
#include <Core/NamesAndTypes.h>
|
|
#include <Core/NamesAndAliases.h>
|
|
#include <Poco/Message.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
using Poco::Message;
|
|
|
|
struct TextLogElement
|
|
{
|
|
time_t event_time{};
|
|
Decimal64 event_time_microseconds{};
|
|
UInt32 microseconds{};
|
|
|
|
String thread_name;
|
|
UInt64 thread_id{};
|
|
|
|
Message::Priority level = Message::PRIO_TRACE;
|
|
|
|
String query_id;
|
|
String logger_name;
|
|
String message;
|
|
|
|
String source_file;
|
|
UInt64 source_line{};
|
|
|
|
static std::string name() { return "TextLog"; }
|
|
static NamesAndTypesList getNamesAndTypes();
|
|
static NamesAndAliases getNamesAndAliases() { return {}; }
|
|
void appendToBlock(MutableColumns & columns) const;
|
|
};
|
|
|
|
class TextLog : public SystemLog<TextLogElement>
|
|
{
|
|
public:
|
|
TextLog(
|
|
ContextPtr context_,
|
|
const String & database_name_,
|
|
const String & table_name_,
|
|
const String & storage_def_,
|
|
size_t flush_interval_milliseconds_);
|
|
};
|
|
|
|
}
|