aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/logger/record.h
blob: 9c2062c3eec378f1c0519a3e4bf46428bbbda0bc (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
#pragma once

#include "priority.h"

#include <util/generic/string.h>
#include <util/generic/vector.h>
#include <util/system/defaults.h>

#include <utility>

struct TLogRecord {
    using TMetaFlags = TVector<std::pair<TString, TString>>;

    const char* Data;
    size_t Len;
    ELogPriority Priority;
    TMetaFlags MetaFlags;

    inline TLogRecord(ELogPriority priority, const char* data, size_t len, TMetaFlags metaFlags = {}) noexcept
        : Data(data)
        , Len(len)
        , Priority(priority)
        , MetaFlags(std::move(metaFlags))
    {
    }
};