Files
EchoionCore/include/echoion/core/commands/ReloadConfigCommand.hpp
T
faumarayandClaude Opus 4.8 2d7651c308 Route all logging through the Void::Log facade
Delete the echoion Logger adapter (Logger.{hpp,cpp}) and the
ILogger/LoggerRegistry indirection. Core::installLogging() builds the
console + split-file Void::Logging::MultiLogger and installs it as the
process-wide Void::Log sink via Void::Log::make_sink (logSink_ owns it for
the process lifetime). The ~450 ECHOION_LOG_* call sites across EchoionCore
are rewritten to Void::Log::<level>("<Subsystem>", "{}", <expr>) with
per-file module tags (warning->warn, critical->fatal); the pre-formatted
message is passed as the single "{}" argument. Build green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:10:06 +03:00

53 lines
1.3 KiB
C++

#pragma once
#include "Command.hpp"
#include <Void/Log/Log.hpp>
#include "echoion/core/Core.hpp" // For Core::reloadConfig
#include <format>
namespace Echoion::Core
{
class ReloadConfigCommand : public Command
{
public:
void execute(const CommandContext& ctx) override
{
try {
// Note: ctx.core is not directly accessible, we need to use
// the MusicManager's core reference For now, reply with
// instructions
ctx.reply(
"Config reload: Please use !reload command or restart "
"the bot for config changes to take effect.");
// TODO: Add core reference to CommandContext so commands
// can call Core methods
} catch (const std::exception& e) {
Void::Log::error("ReloadConfigCommand", "{}", std::format(
"ReloadConfig command exception: {}", e.what()));
ctx.reply("Something went wrong. Please try again.");
}
}
std::string_view getDescription() const override
{
return "Reloads the bot configuration from file.";
}
CommandCategory getCategory() const override
{
return CommandCategory::Admin;
}
bool requiresAdmin() const override { return true; }
std::vector<std::string_view> getAliases() const override
{
return {"reloadcfg", "rlcfg"};
}
};
} // namespace Echoion::Core