OXYGENHUB
◆ main openmsx / src / events / StdioMessages.cc
656 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#include "StdioMessages.hh"
2
3
#include <iostream>
4
5
namespace openmsx {
6
7
void StdioMessages::log(CliComm::LogLevel level, std::string_view message, float fraction) noexcept
8
{
9
	auto& out = (level == CliComm::LogLevel::INFO) ? std::cout : std::cerr;
10
	out << toString(level) << ": " << message;
11
	if (level == CliComm::LogLevel::PROGRESS && fraction >= 0.0f) {
12
		out << "... " << int(100.0f * fraction) << '%';
13
	}
14
	out << '\n' << std::flush;
15
}
16
17
void StdioMessages::update(CliComm::UpdateType /*type*/, std::string_view /*machine*/,
18
                           std::string_view /*name*/, std::string_view /*value*/) noexcept
19
{
20
	// ignore
21
}
22
23
} // namespace openmsx