Coverage Report

Created: 2025-10-23 15:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/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 <memory>
21
22
// GLOG defines this based on the system but doesn't check if it's already
23
// been defined.  undef it first to avoid warnings.
24
// glog MUST be included before gflags.  Instead of including them,
25
// our files should include this file instead.
26
#undef _XOPEN_SOURCE
27
// This is including a glog internal file.  We want this to expose the
28
// function to get the stack trace.
29
#include <glog/logging.h> // IWYU pragma: export
30
#undef MutexLock
31
32
// Define VLOG levels.  We want display per-row info less than per-file which
33
// is less than per-query.  For now per-connection is the same as per-query.
34
#define VLOG_CONNECTION VLOG(1)
35
18.4E
#define VLOG_RPC VLOG(8)
36
18.4E
#define VLOG_QUERY VLOG(1)
37
18.4E
#define VLOG_FILE VLOG(2)
38
18.4E
#define VLOG_ROW VLOG(10)
39
0
#define VLOG_PROGRESS VLOG(2)
40
18.4E
#define VLOG_TRACE VLOG(10)
41
18.4E
#define VLOG_DEBUG VLOG(7)
42
18.4E
#define VLOG_NOTICE VLOG(3)
43
18.4E
#define VLOG_CRITICAL VLOG(1)
44
45
#define VLOG_CONNECTION_IS_ON VLOG_IS_ON(1)
46
#define VLOG_RPC_IS_ON VLOG_IS_ON(8)
47
#define VLOG_QUERY_IS_ON VLOG_IS_ON(1)
48
52.2k
#define VLOG_FILE_IS_ON VLOG_IS_ON(2)
49
#define VLOG_ROW_IS_ON VLOG_IS_ON(10)
50
3.66M
#define VLOG_TRACE_IS_ON VLOG_IS_ON(10)
51
126k
#define VLOG_DEBUG_IS_ON VLOG_IS_ON(7)
52
2.66k
#define VLOG_NOTICE_IS_ON VLOG_IS_ON(3)
53
0
#define VLOG_CRITICAL_IS_ON VLOG_IS_ON(1)
54
55
/// Define a wrapper around DCHECK for strongly typed enums that print a useful error
56
/// message on failure.
57
#define DCHECK_ENUM_EQ(a, b)                                                 \
58
    DCHECK(a == b) << "[ " #a " = " << static_cast<int>(a) << " , " #b " = " \
59
                   << static_cast<int>(b) << " ]"
60
61
#include <fmt/format.h>
62
63
#include "util/uid_util.h"
64
65
namespace doris {
66
67
// glog doesn't allow multiple invocations of InitGoogleLogging. This method conditionally
68
// calls InitGoogleLogging only if it hasn't been called before.
69
bool init_glog(const char* basename);
70
71
// Shuts down the google logging library. Call before exit to ensure that log files are
72
// flushed. May only be called once.
73
void shutdown_logging();
74
75
void update_logging(const std::string& name, const std::string& value);
76
77
class TaggableLogger {
78
public:
79
    TaggableLogger(const char* file, int line, google::LogSeverity severity)
80
2.48M
            : _msg(file, line, severity) {}
81
82
    template <typename... Args>
83
2.48M
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
2.48M
        if constexpr (sizeof...(args) == 0) {
85
945k
            _msg.stream() << fmt;
86
1.54M
        } else {
87
1.54M
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1.54M
        }
89
2.48M
        return *this;
90
2.48M
    }
_ZN5doris14TaggableLoggerclIJEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
945k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
945k
        if constexpr (sizeof...(args) == 0) {
85
945k
            _msg.stream() << fmt;
86
        } else {
87
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
        }
89
945k
        return *this;
90
945k
    }
_ZN5doris14TaggableLoggerclIJRSt17basic_string_viewIcSt11char_traitsIcEEEEERS0_RKS5_DpOT_
Line
Count
Source
83
21.9k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
21.9k
        } else {
87
21.9k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
21.9k
        }
89
21.9k
        return *this;
90
21.9k
    }
_ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
464k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
464k
        } else {
87
464k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
464k
        }
89
464k
        return *this;
90
464k
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNS_6StatusEEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmSA_mRKbEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
150
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
150
        } else {
87
150
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
150
        }
89
150
        return *this;
90
150
    }
_ZN5doris14TaggableLoggerclIJRKmEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
1
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1
        } else {
87
1
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1
        }
89
1
        return *this;
90
1
    }
_ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
1
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1
        } else {
87
1
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1
        }
89
1
        return *this;
90
1
    }
_ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmSA_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
1
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1
        } else {
87
1
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1
        }
89
1
        return *this;
90
1
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRiEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiRNS_6StatusEEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiS8_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
1
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1
        } else {
87
1
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1
        }
89
1
        return *this;
90
1
    }
_ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
2
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
2
        } else {
87
2
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
2
        }
89
2
        return *this;
90
2
    }
_ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS7_mEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
10
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
10
        } else {
87
10
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
10
        }
89
10
        return *this;
90
10
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlS2_S2_EEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRSt17basic_string_viewIcSt11char_traitsIcEEmEEERS0_RKS5_DpOT_
_ZN5doris14TaggableLoggerclIJRbEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
6.28k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
6.28k
        } else {
87
6.28k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
6.28k
        }
89
6.28k
        return *this;
90
6.28k
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERjRmRiEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJmmRmEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris14TaggableLoggerclIJlEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
1.13k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1.13k
        } else {
87
1.13k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1.13k
        }
89
1.13k
        return *this;
90
1.13k
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKlEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlS2_S2_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS6_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_S8_EEERS0_RKSt17basic_string_viewIcS6_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS6_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlS2_EEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJPKcEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
1
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1
        } else {
87
1
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1
        }
89
1
        return *this;
90
1
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEKS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
551k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
551k
        } else {
87
551k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
551k
        }
89
551k
        return *this;
90
551k
    }
_ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERimEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
457k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
457k
        } else {
87
457k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
457k
        }
89
457k
        return *this;
90
457k
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJmNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
16
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
16
        } else {
87
16
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
16
        }
89
16
        return *this;
90
16
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKNS_15TObjStorageType4typeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS9_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNS_5cloud26ObjectStoreInfoPB_ProviderENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS7_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEimEEERS0_RKSt17basic_string_viewIcS6_EDpOT_
_ZN5doris14TaggableLoggerclIJRlS2_S2_RmEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
79
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
79
        } else {
87
79
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
79
        }
89
79
        return *this;
90
79
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiS8_S9_RjRlSB_SB_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERjRlS9_S9_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiRlSA_lRjSA_SA_SA_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
79
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
79
        } else {
87
79
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
79
        }
89
79
        return *this;
90
79
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlS2_S2_RNS_6StatusEEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris14TaggableLoggerclIJRlS2_S2_S2_RKmEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
79
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
79
        } else {
87
79
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
79
        }
89
79
        return *this;
90
79
    }
_ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
188
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
188
        } else {
87
188
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
188
        }
89
188
        return *this;
90
188
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRiRKlS4_EEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris14TaggableLoggerclIJlllEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
21.7k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
21.7k
        } else {
87
21.7k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
21.7k
        }
89
21.7k
        return *this;
90
21.7k
    }
_ZN5doris14TaggableLoggerclIJllllEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
16.3k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
16.3k
        } else {
87
16.3k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
16.3k
        }
89
16.3k
        return *this;
90
16.3k
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS7_RiEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_RiEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRKlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_EEERS0_RKSt17basic_string_viewIcS7_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJilEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris14TaggableLoggerclIJmiEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
930
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
930
        } else {
87
930
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
930
        }
89
930
        return *this;
90
930
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRilEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRilRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEERS0_RKSt17basic_string_viewIcS6_EDpOT_
_ZN5doris14TaggableLoggerclIJlRlEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
1.13k
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
1.13k
        } else {
87
1.13k
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
1.13k
        }
89
1.13k
        return *this;
90
1.13k
    }
_ZN5doris14TaggableLoggerclIJllEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Line
Count
Source
83
89
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
89
        } else {
87
89
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
89
        }
89
89
        return *this;
90
89
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRllEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJRlS2_S2_mEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
_ZN5doris14TaggableLoggerclIJlRlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_S8_S8_S8_S8_EEERS0_RKSt17basic_string_viewIcS6_EDpOT_
Line
Count
Source
83
5
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
5
        } else {
87
5
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
5
        }
89
5
        return *this;
90
5
    }
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJmEEERS0_RKSt17basic_string_viewIcSt11char_traitsIcEEDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERlS7_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Unexecuted instantiation: _ZN5doris14TaggableLoggerclIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERlmEEERS0_RKSt17basic_string_viewIcS5_EDpOT_
_ZN5doris14TaggableLoggerclIJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERiS9_SA_SA_S9_EEERS0_RKSt17basic_string_viewIcS5_EDpOT_
Line
Count
Source
83
48
    TaggableLogger& operator()(const std::string_view& fmt, Args&&... args) {
84
        if constexpr (sizeof...(args) == 0) {
85
            _msg.stream() << fmt;
86
48
        } else {
87
48
            _msg.stream() << fmt::format(fmt, std::forward<Args&&>(args)...);
88
48
        }
89
48
        return *this;
90
48
    }
91
92
    template <typename V>
93
4.41M
    TaggableLogger& tag(std::string_view key, V&& value) {
94
4.41M
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
4.41M
        } else {
98
4.41M
            _msg.stream() << value;
99
4.41M
        }
100
4.41M
        return *this;
101
4.41M
    }
_ZN5doris14TaggableLogger3tagIRKNS_17TAgentTaskRequestEEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
350
    TaggableLogger& tag(std::string_view key, V&& value) {
94
350
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
350
        } else {
98
350
            _msg.stream() << value;
99
350
        }
100
350
        return *this;
101
350
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRKNS_9TTaskType4typeEEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
_ZN5doris14TaggableLogger3tagIRKiEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
70
    TaggableLogger& tag(std::string_view key, V&& value) {
94
70
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
70
        } else {
98
70
            _msg.stream() << value;
99
70
        }
100
70
        return *this;
101
70
    }
_ZN5doris14TaggableLogger3tagIRKlEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
204k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
204k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
204k
        } else {
98
204k
            _msg.stream() << value;
99
204k
        }
100
204k
        return *this;
101
204k
    }
_ZN5doris14TaggableLogger3tagIRlEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
510k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
510k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
510k
        } else {
98
510k
            _msg.stream() << value;
99
510k
        }
100
510k
        return *this;
101
510k
    }
_ZN5doris14TaggableLogger3tagIlEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
1.00M
    TaggableLogger& tag(std::string_view key, V&& value) {
94
1.00M
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
1.00M
        } else {
98
1.00M
            _msg.stream() << value;
99
1.00M
        }
100
1.00M
        return *this;
101
1.00M
    }
_ZN5doris14TaggableLogger3tagIRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERS0_St17basic_string_viewIcS5_EOT_
Line
Count
Source
93
60
    TaggableLogger& tag(std::string_view key, V&& value) {
94
60
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
60
        } else {
98
60
            _msg.stream() << value;
99
60
        }
100
60
        return *this;
101
60
    }
_ZN5doris14TaggableLogger3tagIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERS0_St17basic_string_viewIcS5_EOT_
Line
Count
Source
93
67.2k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
67.2k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
67.2k
        } else {
98
67.2k
            _msg.stream() << value;
99
67.2k
        }
100
67.2k
        return *this;
101
67.2k
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRjEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRKbEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
_ZN5doris14TaggableLogger3tagINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERS0_St17basic_string_viewIcS5_EOT_
Line
Count
Source
93
1.45M
    TaggableLogger& tag(std::string_view key, V&& value) {
94
1.45M
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
1.45M
        } else {
98
1.45M
            _msg.stream() << value;
99
1.45M
        }
100
1.45M
        return *this;
101
1.45M
    }
_ZN5doris14TaggableLogger3tagIRKNS_9TPushType4typeEEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
1.54k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
1.54k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
1.54k
        } else {
98
1.54k
            _msg.stream() << value;
99
1.54k
        }
100
1.54k
        return *this;
101
1.54k
    }
_ZN5doris14TaggableLogger3tagImEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
333k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
333k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
333k
        } else {
98
333k
            _msg.stream() << value;
99
333k
        }
100
333k
        return *this;
101
333k
    }
_ZN5doris14TaggableLogger3tagIPcEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
1
    TaggableLogger& tag(std::string_view key, V&& value) {
94
1
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
1
        } else {
98
1
            _msg.stream() << value;
99
1
        }
100
1
        return *this;
101
1
    }
_ZN5doris14TaggableLogger3tagIRiEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
632k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
632k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
632k
        } else {
98
632k
            _msg.stream() << value;
99
632k
        }
100
632k
        return *this;
101
632k
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRKmEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIPKcEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
_ZN5doris14TaggableLogger3tagIRmEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
70.1k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
70.1k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
70.1k
        } else {
98
70.1k
            _msg.stream() << value;
99
70.1k
        }
100
70.1k
        return *this;
101
70.1k
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIjEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRbEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagISt17basic_string_viewIcSt11char_traitsIcEEEERS0_S5_OT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRKSt6vectorINS_7VersionESaIS3_EEEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
_ZN5doris14TaggableLogger3tagIiEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Line
Count
Source
93
133k
    TaggableLogger& tag(std::string_view key, V&& value) {
94
133k
        _msg.stream() << '|' << key << '=';
95
        if constexpr (std::is_same_v<V, TUniqueId> || std::is_same_v<V, PUniqueId>) {
96
            _msg.stream() << print_id(value);
97
133k
        } else {
98
133k
            _msg.stream() << value;
99
133k
        }
100
133k
        return *this;
101
133k
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRA8_KcEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRA10_KcEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRA32_KcEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
Unexecuted instantiation: _ZN5doris14TaggableLogger3tagIRNS_6StatusEEERS0_St17basic_string_viewIcSt11char_traitsIcEEOT_
102
103
    template <typename E>
104
994
    TaggableLogger& error(E&& error) {
105
994
        _msg.stream() << "|error=" << error;
106
994
        return *this;
107
994
    }
_ZN5doris14TaggableLogger5errorIRNS_6StatusEEERS0_OT_
Line
Count
Source
104
994
    TaggableLogger& error(E&& error) {
105
994
        _msg.stream() << "|error=" << error;
106
994
        return *this;
107
994
    }
Unexecuted instantiation: _ZN5doris14TaggableLogger5errorIRNS_7TStatusEEERS0_OT_
108
109
private:
110
    google::LogMessage _msg;
111
};
112
113
// Very very important!!!!
114
// Never define LOG_DEBUG or LOG_TRACE. because the tagged logging method will
115
// always generated string and then check the log level, its performane is bad.
116
// glog's original method will first check log level if it is not satisfied,
117
// the log message is not generated.
118
4.44M
#define LOG_INFO TaggableLogger(__FILE__, __LINE__, google::GLOG_INFO)
119
269k
#define LOG_WARNING TaggableLogger(__FILE__, __LINE__, google::GLOG_WARNING)
120
2
#define LOG_ERROR TaggableLogger(__FILE__, __LINE__, google::GLOG_ERROR)
121
0
#define LOG_FATAL TaggableLogger(__FILE__, __LINE__, google::GLOG_FATAL)
122
123
// Avoid the printed log message is truncated by the glog max log size limit
124
#define LOG_LONG_STRING(severity, long_log_str)                                \
125
2
    do {                                                                       \
126
2
        constexpr size_t max_log_size = 30000 - 100;                           \
127
2
        size_t pos = 0;                                                        \
128
2
        size_t total_size = long_log_str.size();                               \
129
2
        size_t tmp_size = std::min(max_log_size, total_size);                  \
130
4
        while (pos < total_size) {                                             \
131
2
            tmp_size = std::min(max_log_size, total_size - pos);               \
132
2
            LOG(severity) << std::string(long_log_str.data() + pos, tmp_size); \
133
2
            pos += tmp_size;                                                   \
134
2
        }                                                                      \
135
2
    } while (0)
136
137
} // namespace doris