diff --git a/src/baseloop.cpp b/src/baseloop.cpp index c03cbc01..7bb2bed3 100644 --- a/src/baseloop.cpp +++ b/src/baseloop.cpp @@ -78,7 +78,7 @@ std::string BaseLoop::decodeMessage(const std::string& data) case get: if (cmd.size() < 3) { - result << "format: type class cmd [sub]"; + result << "format: get class cmd (sub)"; break; } @@ -120,7 +120,7 @@ std::string BaseLoop::decodeMessage(const std::string& data) case set: if (cmd.size() != 4) { - result << "format: type class cmd value"; + result << "format: set class cmd value"; break; } @@ -173,7 +173,7 @@ std::string BaseLoop::decodeMessage(const std::string& data) case cyc: if (cmd.size() < 3) { - result << "format: type class cmd [sub]"; + result << "format: cyc class cmd (sub)"; break; } @@ -200,12 +200,22 @@ std::string BaseLoop::decodeMessage(const std::string& data) break; case dump: + if (cmd.size() < 2) { + result << "format: dump on|off"; + break; + } + if (cmd[1] == "on") m_ebusloop->dump(true); if (cmd[1] == "off") m_ebusloop->dump(false); result << "done"; break; case log: + if (cmd.size() < 2) { + result << "format: log error|event|trace|debug"; + break; + } + if (cmd[1] == "error") L.getSink(0)->setLevel(error); if (cmd[1] == "event") L.getSink(0)->setLevel(event); if (cmd[1] == "trace") L.getSink(0)->setLevel(trace); diff --git a/src/main.cpp b/src/main.cpp index 241e1ba7..b3d0e48f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,11 +84,11 @@ void define_args() "\tlog file name (default: /var/log/ebus-daemon.log)", Appl::type_string, Appl::opt_mandatory); - A.addItem("p_area", Appl::Param(all), "", "logarea", + A.addItem("p_logarea", Appl::Param(all), "", "logarea", "\tlogging area (bas=1, net=2, bus=4, cyc=8, default: all=15)", Appl::type_int, Appl::opt_mandatory); - A.addItem("p_level", Appl::Param(trace), "", "loglevel", + A.addItem("p_loglevel", Appl::Param(trace), "", "loglevel", "\tlogging level (error=0, event=1, default: trace=2, debug=3)\n", Appl::type_int, Appl::opt_mandatory); @@ -196,13 +196,13 @@ int main(int argc, char* argv[]) // make me Daemon if (A.getParam("p_foreground") == true) { - L += new LogConsole(A.getParam("p_area"), - static_cast(A.getParam("p_level")), + L += new LogConsole(A.getParam("p_logarea"), + static_cast(A.getParam("p_loglevel")), "logConsole"); } else { D.run("/var/run/ebus-daemon.pid"); - L += new LogFile(A.getParam("p_area"), - static_cast(A.getParam("p_level")), + L += new LogFile(A.getParam("p_logarea"), + static_cast(A.getParam("p_loglevel")), "logFile", A.getParam("p_logfile")); }