Coverage Report

Created: 2026-10-10 17:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/cloud/src/common/logging.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <butil/containers/linked_list.h>
21
#include <fmt/format.h>
22
#include <glog/logging.h>
23
24
#include <string_view>
25
#include <type_traits>
26
27
namespace doris::cloud {
28
29
bool init_glog(const char* basename);
30
31
/// Wrap a glog stream and tag on the log. usage:
32
///   LOG_INFO("here is an info for a {} query", query_type).tag("query_id", queryId);
33
423k
#define LOG_INFO(...) ::doris::cloud::TaggableLogger(LOG(INFO), ##__VA_ARGS__)
34
6.20k
#define LOG_WARNING(...) ::doris::cloud::TaggableLogger(LOG(WARNING), ##__VA_ARGS__)
35
7
#define LOG_ERROR(...) ::doris::cloud::TaggableLogger(LOG(ERROR), ##__VA_ARGS__)
36
0
#define LOG_FATAL(...) ::doris::cloud::TaggableLogger(LOG(FATAL), ##__VA_ARGS__)
37
38
class AnnotateTag final : public butil::LinkNode<AnnotateTag> {
39
    struct default_tag_t {};
40
    constexpr static default_tag_t default_tag {};
41
42
public:
43
    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, T>>
44
    AnnotateTag(std::string_view key, T value)
45
2.24k
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IllEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
2.22k
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IccEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IbbEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
3
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IaaEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IhhEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IssEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IttEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IiiEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2IjjEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
_ZN5doris5cloud11AnnotateTagC2ImmEESt17basic_string_viewIcSt11char_traitsIcEET_
Line
Count
Source
45
1
            : AnnotateTag(default_tag, key, std::to_string(value)) {}
46
    AnnotateTag(std::string_view key, std::string_view value);
47
    ~AnnotateTag();
48
49
    static void format_tag_list(std::ostream& stream);
50
51
    static void* operator new(size_t) = delete;
52
    static void* operator new[](size_t) = delete;
53
54
private:
55
    explicit AnnotateTag(default_tag_t, std::string_view key, std::string value);
56
57
    std::string_view key_;
58
    std::string value_;
59
};
60
61
class TaggableLogger {
62
public:
63
    template <typename... Args>
64
429k
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
429k
        if constexpr (sizeof...(args) == 0) {
66
426k
            stream_ << fmt;
67
426k
        } else {
68
2.66k
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
2.66k
        }
70
429k
        AnnotateTag::format_tag_list(stream_);
71
429k
    };
_ZN5doris5cloud14TaggableLoggerC2IJEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
426k
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
426k
        if constexpr (sizeof...(args) == 0) {
66
426k
            stream_ << fmt;
67
        } else {
68
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
        }
70
426k
        AnnotateTag::format_tag_list(stream_);
71
426k
    };
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJRSt17basic_string_viewIcSt11char_traitsIcEEEEERSoS6_DpOT_
_ZN5doris5cloud14TaggableLoggerC2IJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS8_S8_EEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
50
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
50
        } else {
68
50
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
50
        }
70
50
        AnnotateTag::format_tag_list(stream_);
71
50
    };
_ZN5doris5cloud14TaggableLoggerC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
365
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
365
        } else {
68
365
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
365
        }
70
365
        AnnotateTag::format_tag_list(stream_);
71
365
    };
_ZN5doris5cloud14TaggableLoggerC2IJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_S8_EEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
4
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
4
        } else {
68
4
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
4
        }
70
4
        AnnotateTag::format_tag_list(stream_);
71
4
    };
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_SA_EEERSoSt17basic_string_viewIcS6_EDpOT_
_ZN5doris5cloud14TaggableLoggerC2IJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
6
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
6
        } else {
68
6
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
6
        }
70
6
        AnnotateTag::format_tag_list(stream_);
71
6
    };
_ZN5doris5cloud14TaggableLoggerC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS8_lRlRKS8_EEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
1
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
1
        } else {
68
1
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
1
        }
70
1
        AnnotateTag::format_tag_list(stream_);
71
1
    };
_ZN5doris5cloud14TaggableLoggerC2IJRlEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
310
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
310
        } else {
68
310
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
310
        }
70
310
        AnnotateTag::format_tag_list(stream_);
71
310
    };
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJRKlEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJiRiEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris5cloud14TaggableLoggerC2IJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEilEEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
2
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
2
        } else {
68
2
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
2
        }
70
2
        AnnotateTag::format_tag_list(stream_);
71
2
    };
_ZN5doris5cloud14TaggableLoggerC2IJmRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
6
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
6
        } else {
68
6
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
6
        }
70
6
        AnnotateTag::format_tag_list(stream_);
71
6
    };
_ZN5doris5cloud14TaggableLoggerC2IJRlRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERSoSt17basic_string_viewIcS7_EDpOT_
Line
Count
Source
64
2
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
2
        } else {
68
2
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
2
        }
70
2
        AnnotateTag::format_tag_list(stream_);
71
2
    };
_ZN5doris5cloud14TaggableLoggerC2IJRlRKlRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERSoSt17basic_string_viewIcS9_EDpOT_
Line
Count
Source
64
1
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
1
        } else {
68
1
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
1
        }
70
1
        AnnotateTag::format_tag_list(stream_);
71
1
    };
_ZN5doris5cloud14TaggableLoggerC2IJRlRKlEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
514
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
514
        } else {
68
514
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
514
        }
70
514
        AnnotateTag::format_tag_list(stream_);
71
514
    };
_ZN5doris5cloud14TaggableLoggerC2IJRlRKlNS0_11TxnStatusPBEEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
4
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
4
        } else {
68
4
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
4
        }
70
4
        AnnotateTag::format_tag_list(stream_);
71
4
    };
_ZN5doris5cloud14TaggableLoggerC2IJmRlEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
1
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
1
        } else {
68
1
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
1
        }
70
1
        AnnotateTag::format_tag_list(stream_);
71
1
    };
_ZN5doris5cloud14TaggableLoggerC2IJRNS0_12TxnErrorCodeEEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
1
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
1
        } else {
68
1
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
1
        }
70
1
        AnnotateTag::format_tag_list(stream_);
71
1
    };
_ZN5doris5cloud14TaggableLoggerC2IJRfEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
348
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
348
        } else {
68
348
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
348
        }
70
348
        AnnotateTag::format_tag_list(stream_);
71
348
    };
_ZN5doris5cloud14TaggableLoggerC2IJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKlRS8_SD_EEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
6
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
6
        } else {
68
6
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
6
        }
70
6
        AnnotateTag::format_tag_list(stream_);
71
6
    };
_ZN5doris5cloud14TaggableLoggerC2IJmmEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
13
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
13
        } else {
68
13
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
13
        }
70
13
        AnnotateTag::format_tag_list(stream_);
71
13
    };
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJRiEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris5cloud14TaggableLoggerC2IJmRmlEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
5
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
5
        } else {
68
5
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
5
        }
70
5
        AnnotateTag::format_tag_list(stream_);
71
5
    };
_ZN5doris5cloud14TaggableLoggerC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS8_EEERSoSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
64
1.02k
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
1.02k
        } else {
68
1.02k
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
1.02k
        }
70
1.02k
        AnnotateTag::format_tag_list(stream_);
71
1.02k
    };
_ZN5doris5cloud14TaggableLoggerC2IJmRmEEERSoSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
64
5
    TaggableLogger(std::ostream& stream, std::string_view fmt, Args&&... args) : stream_(stream) {
65
        if constexpr (sizeof...(args) == 0) {
66
            stream_ << fmt;
67
5
        } else {
68
5
            stream_ << fmt::format(fmt, std::forward<Args>(args)...);
69
5
        }
70
5
        AnnotateTag::format_tag_list(stream_);
71
5
    };
Unexecuted instantiation: _ZN5doris5cloud14TaggableLoggerC2IJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdEEERSoSt17basic_string_viewIcS6_EDpOT_
72
73
    template <typename V>
74
1.57M
    TaggableLogger& tag(std::string_view key, const V& value) {
75
1.57M
        stream_ << ' ' << key << '=';
76
1.57M
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
893k
            stream_ << '"' << value << '"';
78
893k
        } else {
79
680k
            stream_ << value;
80
680k
        }
81
1.57M
        return *this;
82
1.57M
    }
_ZN5doris5cloud14TaggableLogger3tagINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERS1_St17basic_string_viewIcS6_ERKT_
Line
Count
Source
74
893k
    TaggableLogger& tag(std::string_view key, const V& value) {
75
893k
        stream_ << ' ' << key << '=';
76
893k
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
893k
            stream_ << '"' << value << '"';
78
        } else {
79
            stream_ << value;
80
        }
81
893k
        return *this;
82
893k
    }
_ZN5doris5cloud14TaggableLogger3tagIhEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
4
    TaggableLogger& tag(std::string_view key, const V& value) {
75
4
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
4
        } else {
79
4
            stream_ << value;
80
4
        }
81
4
        return *this;
82
4
    }
_ZN5doris5cloud14TaggableLogger3tagItEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
4
    TaggableLogger& tag(std::string_view key, const V& value) {
75
4
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
4
        } else {
79
4
            stream_ << value;
80
4
        }
81
4
        return *this;
82
4
    }
_ZN5doris5cloud14TaggableLogger3tagINS0_12TxnErrorCodeEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
9
    TaggableLogger& tag(std::string_view key, const V& value) {
75
9
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
9
        } else {
79
9
            stream_ << value;
80
9
        }
81
9
        return *this;
82
9
    }
_ZN5doris5cloud14TaggableLogger3tagIiEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
212k
    TaggableLogger& tag(std::string_view key, const V& value) {
75
212k
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
212k
        } else {
79
212k
            stream_ << value;
80
212k
        }
81
212k
        return *this;
82
212k
    }
_ZN5doris5cloud14TaggableLogger3tagIPKcEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
3
    TaggableLogger& tag(std::string_view key, const V& value) {
75
3
        stream_ << ' ' << key << '=';
76
3
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
3
            stream_ << '"' << value << '"';
78
        } else {
79
            stream_ << value;
80
        }
81
3
        return *this;
82
3
    }
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagIA38_cEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagIA33_cEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
_ZN5doris5cloud14TaggableLogger3tagImEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
37.6k
    TaggableLogger& tag(std::string_view key, const V& value) {
75
37.6k
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
37.6k
        } else {
79
37.6k
            stream_ << value;
80
37.6k
        }
81
37.6k
        return *this;
82
37.6k
    }
_ZN5doris5cloud14TaggableLogger3tagIbEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
56
    TaggableLogger& tag(std::string_view key, const V& value) {
75
56
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
56
        } else {
79
56
            stream_ << value;
80
56
        }
81
56
        return *this;
82
56
    }
_ZN5doris5cloud14TaggableLogger3tagIlEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
429k
    TaggableLogger& tag(std::string_view key, const V& value) {
75
429k
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
429k
        } else {
79
429k
            stream_ << value;
80
429k
        }
81
429k
        return *this;
82
429k
    }
_ZN5doris5cloud14TaggableLogger3tagINS0_23RestoreJobCloudPB_StateEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
20
    TaggableLogger& tag(std::string_view key, const V& value) {
75
20
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
20
        } else {
79
20
            stream_ << value;
80
20
        }
81
20
        return *this;
82
20
    }
_ZN5doris5cloud14TaggableLogger3tagINS0_15MetaServiceCodeEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
370
    TaggableLogger& tag(std::string_view key, const V& value) {
75
370
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
370
        } else {
79
370
            stream_ << value;
80
370
        }
81
370
        return *this;
82
370
    }
_ZN5doris5cloud14TaggableLogger3tagIjEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
10
    TaggableLogger& tag(std::string_view key, const V& value) {
75
10
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
10
        } else {
79
10
            stream_ << value;
80
10
        }
81
10
        return *this;
82
10
    }
_ZN5doris5cloud14TaggableLogger3tagISt17basic_string_viewIcSt11char_traitsIcEEEERS1_S6_RKT_
Line
Count
Source
74
61
    TaggableLogger& tag(std::string_view key, const V& value) {
75
61
        stream_ << ' ' << key << '=';
76
61
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
61
            stream_ << '"' << value << '"';
78
        } else {
79
            stream_ << value;
80
        }
81
61
        return *this;
82
61
    }
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagINS0_20InstanceRecycleStateEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagINS0_21InstanceInfoPB_StatusEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
_ZN5doris5cloud14TaggableLogger3tagISt6atomicIlEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
189
    TaggableLogger& tag(std::string_view key, const V& value) {
75
189
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
189
        } else {
79
189
            stream_ << value;
80
189
        }
81
189
        return *this;
82
189
    }
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagIA21_cEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagIA43_cEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
_ZN5doris5cloud14TaggableLogger3tagINS0_20RecycleIndexPB_StateEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
2
    TaggableLogger& tag(std::string_view key, const V& value) {
75
2
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
2
        } else {
79
2
            stream_ << value;
80
2
        }
81
2
        return *this;
82
2
    }
_ZN5doris5cloud14TaggableLogger3tagINS0_24TableStreamOffsetStatePBEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
Line
Count
Source
74
2
    TaggableLogger& tag(std::string_view key, const V& value) {
75
2
        stream_ << ' ' << key << '=';
76
        if constexpr (std::is_convertible_v<V, std::string_view>) {
77
            stream_ << '"' << value << '"';
78
2
        } else {
79
2
            stream_ << value;
80
2
        }
81
2
        return *this;
82
2
    }
Unexecuted instantiation: _ZN5doris5cloud14TaggableLogger3tagINS0_18MultiVersionStatusEEERS1_St17basic_string_viewIcSt11char_traitsIcEERKT_
83
84
private:
85
    std::ostream& stream_;
86
};
87
88
} // namespace doris::cloud
89
90
// To keep it simple and practical, we don't actually need so many VLOG levels.
91
// Using `VLOG(${number})` is confusing and hard to desid in most cases, all we
92
// need is a complementary debug level to glog's default 4 levels of logging.
93
// "One VLOG level to rule them all!"
94
#define DEBUG 5
95
// VLOG_DEBUG is alias of VLOG(DEBUG) I.O.W VLOG(5)
96
18
#define VLOG_DEBUG VLOG(DEBUG)