Merge pull request #167 from mutouyun/refactor/log

refactor(log): Remove deprecated utility/log.h
This commit is contained in:
木头云 2025-12-18 11:38:22 +08:00 committed by GitHub
commit 858a7a6e38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,39 +0,0 @@
#pragma once
#include <cstdio>
#include <utility>
namespace ipc {
namespace detail {
template <typename O>
void print(O out, char const * str) {
std::fprintf(out, "%s", str);
}
template <typename O, typename P1, typename... P>
void print(O out, char const * fmt, P1&& p1, P&&... params) {
std::fprintf(out, fmt, std::forward<P1>(p1), std::forward<P>(params)...);
}
} // namespace detail
inline void log(char const * fmt) {
ipc::detail::print(stdout, fmt);
}
template <typename P1, typename... P>
void log(char const * fmt, P1&& p1, P&&... params) {
ipc::detail::print(stdout, fmt, std::forward<P1>(p1), std::forward<P>(params)...);
}
inline void error(char const * str) {
ipc::detail::print(stderr, str);
}
template <typename P1, typename... P>
void error(char const * fmt, P1&& p1, P&&... params) {
ipc::detail::print(stderr, fmt, std::forward<P1>(p1), std::forward<P>(params)...);
}
} // namespace ipc