mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +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) {
|
static void console_log_level(Shell & shell, const std::vector<std::string> & arguments) {
|
||||||
if (!arguments.empty()) {
|
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;
|
uuid::log::Level level;
|
||||||
|
|
||||||
if (uuid::log::parse_level_lowercase(arguments[0], 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)},
|
string_vector{F_(show), F_(devices)},
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) { to_app(shell).show_devices(shell); });
|
[](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) {
|
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);
|
to_app(shell).show_ems(shell);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ MAKE_WORD_CUSTOM(typeid_mandatory, "<type ID>")
|
|||||||
MAKE_WORD_CUSTOM(deviceid_mandatory, "<deviceID>")
|
MAKE_WORD_CUSTOM(deviceid_mandatory, "<deviceID>")
|
||||||
MAKE_WORD_CUSTOM(device_type_optional, "[device]")
|
MAKE_WORD_CUSTOM(device_type_optional, "[device]")
|
||||||
MAKE_WORD_CUSTOM(invalid_log_level, "Invalid log level")
|
MAKE_WORD_CUSTOM(invalid_log_level, "Invalid log level")
|
||||||
MAKE_WORD_CUSTOM(log_level_optional, "[level | show]")
|
MAKE_WORD_CUSTOM(log_level_optional, "[level]")
|
||||||
MAKE_WORD_CUSTOM(name_mandatory, "<name>")
|
MAKE_WORD_CUSTOM(name_mandatory, "<name>")
|
||||||
MAKE_WORD_CUSTOM(name_optional, "[name]")
|
MAKE_WORD_CUSTOM(name_optional, "[name]")
|
||||||
MAKE_WORD_CUSTOM(new_password_prompt1, "Enter new password: ")
|
MAKE_WORD_CUSTOM(new_password_prompt1, "Enter new password: ")
|
||||||
|
|||||||
Reference in New Issue
Block a user