mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-04 02:10:24 +00:00
Make log_file_info() use variadic templates.
This commit is contained in:
parent
f4b91ecaf0
commit
d173c2c51f
2 changed files with 11 additions and 17 deletions
|
@ -202,13 +202,6 @@ static void logv_string(std::string_view format, std::string str) {
|
|||
}
|
||||
}
|
||||
|
||||
static void logv(const char *format, va_list ap)
|
||||
{
|
||||
if (log_make_debug && !ys_debug(1))
|
||||
return;
|
||||
logv_string(format, vstringf(format, ap));
|
||||
}
|
||||
|
||||
void log_formatted_string(std::string_view format, std::string str)
|
||||
{
|
||||
if (log_make_debug && !ys_debug(1))
|
||||
|
@ -315,15 +308,9 @@ void log_formatted_file_warning(std::string_view filename, int lineno, std::stri
|
|||
log_formatted_warning(prefix, std::move(str));
|
||||
}
|
||||
|
||||
void log_file_info(const std::string &filename, int lineno,
|
||||
const char *format, ...)
|
||||
void log_formatted_file_info(std::string_view filename, int lineno, std::string str)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
std::string fmt = stringf("%s:%d: Info: %s",
|
||||
filename.c_str(), lineno, format);
|
||||
logv(fmt.c_str(), ap);
|
||||
va_end(ap);
|
||||
log("%s:%d: Info: %s", filename, lineno, str);
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue