openMSX
StdioMessages.cc
Go to the documentation of this file.
1#include "StdioMessages.hh"
2#include <iostream>
3
4namespace openmsx {
5
6void StdioMessages::log(CliComm::LogLevel level, std::string_view message, float fraction) noexcept
7{
8 auto& out = (level == CliComm::LogLevel::INFO) ? std::cout : std::cerr;
9 out << toString(level) << ": " << message;
10 if (level == CliComm::LogLevel::PROGRESS && fraction >= 0.0f) {
11 out << "... " << int(100.0f * fraction) << '%';
12 }
13 out << '\n' << std::flush;
14}
15
16void StdioMessages::update(CliComm::UpdateType /*type*/, std::string_view /*machine*/,
17 std::string_view /*name*/, std::string_view /*value*/) noexcept
18{
19 // ignore
20}
21
22} // namespace openmsx
void update(CliComm::UpdateType type, std::string_view machine, std::string_view name, std::string_view value) noexcept override
void log(CliComm::LogLevel level, std::string_view message, float fraction) noexcept override
This file implemented 3 utility functions:
Definition Autofire.cc:11
std::string toString(const BooleanInput &input)