openMSX
StdioMessages.cc
Go to the documentation of this file.
1 #include "StdioMessages.hh"
2 #include <iostream>
3 
4 using std::string;
5 
6 namespace openmsx {
7 
8 void StdioMessages::log(CliComm::LogLevel level, std::string_view message)
9 {
10  auto levelStr = CliComm::getLevelStrings();
11  ((level == CliComm::INFO) ? std::cout : std::cerr) <<
12  levelStr[level] << ": " << message << '\n' << std::flush;
13 
14 }
15 
16 void StdioMessages::update(CliComm::UpdateType /*type*/, std::string_view /*machine*/,
17  std::string_view /*name*/, std::string_view /*value*/)
18 {
19  // ignore
20 }
21 
22 } // namespace openmsx
openmsx::CliComm::getLevelStrings
static span< const char *const > getLevelStrings()
Definition: CliComm.hh:78
openmsx::StdioMessages::update
void update(CliComm::UpdateType type, std::string_view machine, std::string_view name, std::string_view value) override
Definition: StdioMessages.cc:16
openmsx::CliComm::UpdateType
UpdateType
Definition: CliComm.hh:20
StdioMessages.hh
openmsx::CliComm::LogLevel
LogLevel
Definition: CliComm.hh:13
openmsx::StdioMessages::log
void log(CliComm::LogLevel level, std::string_view message) override
Definition: StdioMessages.cc:8
openmsx::CliComm::INFO
@ INFO
Definition: CliComm.hh:14
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5