blob: 771a27159f03505659a516536ef017f7ae46803a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#pragma once
#include <string>
namespace Poco
{
class Message;
}
namespace DB
{
/// Poco::Message with more ClickHouse-specific info
/// NOTE: Poco::Message is not polymorphic class, so we can't use inheritance in couple with dynamic_cast<>()
class ExtendedLogMessage
{
public:
explicit ExtendedLogMessage(const Poco::Message & base_) : base(base_) {}
/// Attach additional data to the message
static ExtendedLogMessage getFrom(const Poco::Message & base);
// Do not copy for efficiency reasons
const Poco::Message & base;
uint32_t time_seconds = 0;
uint32_t time_microseconds = 0;
uint64_t time_in_microseconds = 0;
uint64_t thread_id = 0;
std::string query_id;
};
/// Interface extension of Poco::Channel
class ExtendedLogChannel
{
public:
virtual void logExtended(const ExtendedLogMessage & msg) = 0;
virtual ~ExtendedLogChannel() = default;
};
}
|