mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
show log
This commit is contained in:
@@ -51,12 +51,6 @@ static inline EMSESP & to_app(Shell & shell) {
|
||||
|
||||
static void console_log_level(Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (!arguments.empty()) {
|
||||
// special command called show which dumps out the contents of the web log buffer
|
||||
if (arguments[0] == "show") {
|
||||
EMSESP::webLogService.show(shell);
|
||||
return;
|
||||
}
|
||||
|
||||
uuid::log::Level level;
|
||||
|
||||
if (uuid::log::parse_level_lowercase(arguments[0], level)) {
|
||||
@@ -97,6 +91,10 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
|
||||
string_vector{F_(show), F_(devices)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) { to_app(shell).show_devices(shell); });
|
||||
|
||||
commands->add_command(ShellContext::MAIN, CommandFlags::USER, string_vector{F_(show), F_(log)}, [](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
to_app(shell).webLogService.show(shell);
|
||||
});
|
||||
|
||||
|
||||
commands->add_command(ShellContext::MAIN, CommandFlags::USER, string_vector{F_(show), F_(ems)}, [](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
to_app(shell).show_ems(shell);
|
||||
|
||||
Reference in New Issue
Block a user