mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Fix printing
This commit is contained in:
@@ -289,8 +289,7 @@ namespace
|
||||
if (options.use_gdb)
|
||||
{
|
||||
const auto* address = "127.0.0.1:28960";
|
||||
win_emu.log.print(color::pink, "Waiting for GDB connection on %s...\n", address);
|
||||
win_emu.log.disable_output(options.concise_logging || options.silent);
|
||||
win_emu.log.force_print(color::pink, "Waiting for GDB connection on %s...\n", address);
|
||||
|
||||
const auto should_stop = [&] { return signals_received > 0; };
|
||||
|
||||
@@ -305,7 +304,6 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
win_emu.log.disable_output(options.concise_logging || options.silent);
|
||||
win_emu.start();
|
||||
}
|
||||
|
||||
@@ -460,7 +458,12 @@ namespace
|
||||
const auto win_emu = setup_emulator(options, args);
|
||||
context.win_emu = win_emu.get();
|
||||
|
||||
win_emu->log.log("Using emulator: %s\n", win_emu->emu().get_name().c_str());
|
||||
win_emu->log.disable_output(concise_logging || options.silent);
|
||||
|
||||
if (!options.silent)
|
||||
{
|
||||
win_emu->log.force_print(color::gray, "Using emulator backend: %s\n", win_emu->emu().get_name().c_str());
|
||||
}
|
||||
|
||||
std::optional<tenet_tracer> tenet_tracer{};
|
||||
if (options.tenet_trace)
|
||||
|
||||
@@ -146,6 +146,13 @@ void logger::print(const color c, const char* message, ...)
|
||||
this->print_message(c, data);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(cert-dcl50-cpp)
|
||||
void logger::force_print(const color c, const char* message, ...)
|
||||
{
|
||||
format_to_string(message, data);
|
||||
this->print_message(c, data, true);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(cert-dcl50-cpp)
|
||||
void logger::info(const char* message, ...) const
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ class logger : public generic_logger
|
||||
public:
|
||||
void print(color c, std::string_view message) override;
|
||||
void print(color c, const char* message, ...) override FORMAT_ATTRIBUTE(3, 4);
|
||||
void force_print(color c, const char* message, ...) FORMAT_ATTRIBUTE(3, 4);
|
||||
void info(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
||||
void warn(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
||||
void error(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
||||
|
||||
Reference in New Issue
Block a user