Skip to content

Commit

Permalink
blink1control: api server logging control easier
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Sep 9, 2015
1 parent 5475146 commit fd01d60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions qt/blink1control/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,18 @@ void HttpServer::startRead(){
resp.insert("status",QString("last color"));
}
else if( cmd=="/logging" ) {
QString levelstr = qurlquery.queryItemValue("loglevel");
QString levelstr="";
if( qurlquery.hasQueryItem("loglevel") ) {
levelstr = qurlquery.queryItemValue("loglevel");
} else if( qurlquery.hasQueryItem("logLevel") ) {
levelstr = qurlquery.queryItemValue("logLevel");
}
if( levelstr == "1" || levelstr == "0" ) {
mw->startOrStopLogging(levelstr.toInt());
}
resp.insert("loglevel",mw->getLogging());

resp.insert("loglevel",(mw->getLogging()) ? 1 : 0);
resp.insert("logfile", mw->getLogFileName());
resp.insert("status",QString("logging"));
}
else if( cmd=="/input" || cmd=="/inputs" ) {
Expand Down
2 changes: 1 addition & 1 deletion qt/blink1control/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ MainWindow::MainWindow(QWidget *parent) :
void MainWindow::goingToSleep()
{
addToLog("goingToSleep...");
sleepytime = true;
sleepytime = true;
on_buttonOff_clicked();
}
// call when we know we've been woken up
Expand Down

0 comments on commit fd01d60

Please sign in to comment.