mirror of https://github.com/YosysHQ/yosys.git
log: fix some functionality and wrappers
This commit is contained in:
parent
cbbd8c0dfd
commit
b17b5a19e0
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
Yosys::log_streams.push_back(&std::cout);
|
||||
Yosys::log_sinks.push_back(std::make_unique<Yosys::ConsoleLogSink>());
|
||||
Yosys::log_error_stderr = true;
|
||||
|
||||
Yosys::yosys_setup();
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (log_errfile == NULL) {
|
||||
log_sinks.push_back(std::make_unique<ConsoleLogSink>());
|
||||
log_error_stderr = true;
|
||||
} else {
|
||||
log_sinks.push_back(std::make_unique<StderrLogSink>());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ void FileLogSink::flush()
|
|||
|
||||
void ConsoleLogSink::log(const LogMessage &msg)
|
||||
{
|
||||
FILE *file = msg.severity == LogSeverity::LOG_ERROR ? stderr : stdout;
|
||||
FILE *file = (msg.severity == LogSeverity::LOG_ERROR && log_error_stderr) ? stderr : stdout;
|
||||
fputs(msg.legacy_msg.c_str(), file);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ global_denylist = frozenset(
|
|||
"log_verific_callback",
|
||||
# incomplete type
|
||||
"yosys_get_tcl_interp",
|
||||
# unique ptr vector
|
||||
"log_sinks",
|
||||
}
|
||||
)
|
||||
pyosys_headers = [
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ namespace pyosys {
|
|||
m.doc() = "python access to libyosys";
|
||||
|
||||
if (!yosys_already_setup()) {
|
||||
log_streams.push_back(&std::cout);
|
||||
log_sinks.push_back(std::make_unique<ConsoleLogSink>());
|
||||
log_error_stderr = true;
|
||||
yosys_setup();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue