ClickHouse/src/Interpreters/TextLog.h

49 lines
1006 B
C++
Raw Normal View History

2019-07-22 13:54:08 +00:00
#pragma once
2019-07-22 13:54:08 +00:00
#include <Interpreters/SystemLog.h>
#include <Core/NamesAndTypes.h>
#include <Core/NamesAndAliases.h>
#include <Poco/Message.h>
2019-07-22 13:54:08 +00:00
2019-07-22 15:09:33 +00:00
namespace DB
{
2019-07-22 13:54:08 +00:00
using Poco::Message;
struct TextLogElement
{
time_t event_time{};
2020-11-03 13:59:17 +00:00
Decimal64 event_time_microseconds{};
2021-05-08 15:20:40 +00:00
UInt32 microseconds{};
2019-07-22 13:54:08 +00:00
String thread_name;
2021-05-08 15:20:40 +00:00
UInt64 thread_id{};
2019-07-22 13:54:08 +00:00
2019-07-22 15:09:33 +00:00
Message::Priority level = Message::PRIO_TRACE;
2019-07-22 13:54:08 +00:00
String query_id;
String logger_name;
String message;
String source_file;
2021-05-08 15:20:40 +00:00
UInt64 source_line{};
2019-07-22 13:54:08 +00:00
static std::string name() { return "TextLog"; }
static NamesAndTypesList getNamesAndTypes();
static NamesAndAliases getNamesAndAliases() { return {}; }
void appendToBlock(MutableColumns & columns) const;
2019-07-22 13:54:08 +00:00
};
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_);
2019-07-22 13:54:08 +00:00
};
2019-07-22 15:09:33 +00:00
}