aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/public/issue/yql_issue_utils.h
blob: 023ea0edbfbdfaa851208df4762b5c685f352d35 (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
#pragma once

#include "yql_issue.h"

#include <util/generic/ylimits.h>
#include <util/system/types.h>

namespace NYql {

struct TTruncateIssueOpts {

#define YQL_TRUNC_DECL_FIELD(type, name, def)    \
    TTruncateIssueOpts& Set##name(type arg##name)& {   \
        name = arg##name;                               \
        return *this;                                   \
    }                                                   \
    TTruncateIssueOpts&& Set##name(type arg##name)&& { \
        name = arg##name;                               \
        return std::move(*this);                        \
    }                                                   \
    type name = def;

    YQL_TRUNC_DECL_FIELD(ui32, MaxLevels, Max<ui32>())
    YQL_TRUNC_DECL_FIELD(ui32, KeepTailLevels, 1)

#undef YQL_TRUNC_DECL_FIELD
};

TIssue TruncateIssueLevels(const TIssue& topIssue, TTruncateIssueOpts opts = {});

} // namespace NYql