aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordakovalkov <dakovalkov@yandex-team.com>2023-10-11 13:20:18 +0300
committerdakovalkov <dakovalkov@yandex-team.com>2023-10-11 13:46:16 +0300
commit0139ecc7de6397d11265ac6544574b8ab9933a7d (patch)
treec4f779eff0d511b245fbb665a577a44bc0c37d10
parentf23fad2ba0d00dc204697a8e10c333690d083b0e (diff)
downloadydb-0139ecc7de6397d11265ac6544574b8ab9933a7d.tar.gz
Prepare for compile time fmt string validation [ydb]
-rw-r--r--ydb/library/yql/udfs/common/clickhouse/client/base/common/logger_useful.h2
-rw-r--r--ydb/library/yql/udfs/common/clickhouse/client/src/Common/DNSResolver.cpp2
-rw-r--r--ydb/library/yql/udfs/common/clickhouse/client/src/Common/Exception.h6
-rw-r--r--ydb/library/yql/udfs/common/clickhouse/client/src/Parsers/DumpASTNode.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/base/common/logger_useful.h b/ydb/library/yql/udfs/common/clickhouse/client/base/common/logger_useful.h
index 6f5250971b4..f19fac51458 100644
--- a/ydb/library/yql/udfs/common/clickhouse/client/base/common/logger_useful.h
+++ b/ydb/library/yql/udfs/common/clickhouse/client/base/common/logger_useful.h
@@ -27,7 +27,7 @@ namespace
(NDB::CurrentThread::getGroup()->client_logs_level >= (priority)); \
if ((logger)->is((PRIORITY)) || is_clients_log) \
{ \
- std::string formatted_message = numArgs(__VA_ARGS__) > 1 ? fmt::format(__VA_ARGS__) : firstArg(__VA_ARGS__); \
+ std::string formatted_message = fmt::format(__VA_ARGS__); \
if (auto channel = (logger)->getChannel()) \
{ \
std::string file_function; \
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/src/Common/DNSResolver.cpp b/ydb/library/yql/udfs/common/clickhouse/client/src/Common/DNSResolver.cpp
index 69761249558..ed4260f5adf 100644
--- a/ydb/library/yql/udfs/common/clickhouse/client/src/Common/DNSResolver.cpp
+++ b/ydb/library/yql/udfs/common/clickhouse/client/src/Common/DNSResolver.cpp
@@ -276,7 +276,7 @@ bool DNSResolver::updateCacheImpl(UpdateF && update_func, ElemsT && elems, const
}
if (!lost_elems.empty())
- LOG_INFO(log, log_msg, lost_elems);
+ LOG_INFO(log, fmt::runtime(log_msg), lost_elems);
return updated;
}
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/src/Common/Exception.h b/ydb/library/yql/udfs/common/clickhouse/client/src/Common/Exception.h
index 4f69452d663..e96a36385c8 100644
--- a/ydb/library/yql/udfs/common/clickhouse/client/src/Common/Exception.h
+++ b/ydb/library/yql/udfs/common/clickhouse/client/src/Common/Exception.h
@@ -36,7 +36,7 @@ public:
// Format message with fmt::format, like the logging functions.
template <typename ...Args>
Exception(int code, const std::string & fmt, Args&&... args)
- : Exception(fmt::format(fmt, std::forward<Args>(args)...), code)
+ : Exception(fmt::format(fmt::runtime(fmt), std::forward<Args>(args)...), code)
{}
struct CreateFromPocoTag {};
@@ -54,7 +54,7 @@ public:
template <typename ...Args>
void addMessage(const std::string& format, Args&&... args)
{
- extendedMessage(fmt::format(format, std::forward<Args>(args)...));
+ extendedMessage(fmt::format(fmt::runtime(format), std::forward<Args>(args)...));
}
void addMessage(const std::string& message)
@@ -115,7 +115,7 @@ public:
// Format message with fmt::format, like the logging functions.
template <typename ...Args>
ParsingException(int code, const std::string & fmt, Args&&... args)
- : Exception(fmt::format(fmt, std::forward<Args>(args)...), code)
+ : Exception(fmt::format(fmt::runtime(fmt), std::forward<Args>(args)...), code)
{}
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/src/Parsers/DumpASTNode.h b/ydb/library/yql/udfs/common/clickhouse/client/src/Parsers/DumpASTNode.h
index e6b7a104dd0..3d78592f0a4 100644
--- a/ydb/library/yql/udfs/common/clickhouse/client/src/Parsers/DumpASTNode.h
+++ b/ydb/library/yql/udfs/common/clickhouse/client/src/Parsers/DumpASTNode.h
@@ -102,7 +102,7 @@ public:
~DebugASTLog()
{
if constexpr (_enable)
- LOG_DEBUG(log, buf.str());
+ LOG_DEBUG(log, "{}", buf.str());
}
WriteBuffer * stream() { return (_enable ? &buf : nullptr); }