{"id":3612,"url":"https://patchwork.libcamera.org/api/1.1/patches/3612/?format=json","web_url":"https://patchwork.libcamera.org/patch/3612/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200429193156.28041-1-laurent.pinchart@ideasonboard.com>","date":"2020-04-29T19:31:56","name":"[libcamera-devel] qcam: Fix logging of sequence number","commit_ref":"bf01e04f29931aa6d64f3d408ce2a374b79254b6","pull_url":null,"state":"accepted","archived":false,"hash":"3b4ad610796815c230b79c18878830e07c4c24b5","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3612/mbox/","series":[{"id":853,"url":"https://patchwork.libcamera.org/api/1.1/series/853/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=853","date":"2020-04-29T19:31:56","name":"[libcamera-devel] qcam: Fix logging of sequence number","version":1,"mbox":"https://patchwork.libcamera.org/series/853/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3612/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3612/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30D9C603F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Apr 2020 21:32:01 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B1ADB521\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Apr 2020 21:32:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"qcGezRVu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588188720;\n\tbh=TEc/83kH+Hb/6JH/dto2IX5+tNX2WjPYscN3Gl4T1k4=;\n\th=From:To:Subject:Date:From;\n\tb=qcGezRVuTbBEJG6Fl7kJtwcTJnV5UnsvpTOKJYhqqyyH+YAb3b0maNW7Wt9eKUW0N\n\tlpZ9Po3Dbk2ZN9jXkfpklrIyffoLWWG30RQZ4fA8ahh+8Hrve4kYC3yR3z91e/SZ4N\n\tOcgkliTdV0UCwLzkRPPezz4FD2PGsiYbPvjdKJzg=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 29 Apr 2020 22:31:56 +0300","Message-Id":"<20200429193156.28041-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.25.3","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] qcam: Fix logging of sequence number","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 29 Apr 2020 19:32:01 -0000"},"content":"The sequence number of captured frames is logged to the console with\npadding to 6 characters to increase readability. The output is however\nincorrect, as 123 is printed as 00012300000. This is caused by the\nauto-space feature of QDebug, which inserts a space after every field.\nThis doesn't play well with stream format manipulation, as it ends up\npadding the automatically inserted space the same way as the previous\nargument.\n\nThis is a bug in Qt, work around it by formatting the sequence number\nmanually.\n\nFixes: 494da4467ddf (\"qcam: Use Qt qInfo() and qWarning() logging facilities\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/qcam/main_window.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex ed0cad417d62..d021fa9552de 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -531,8 +531,8 @@ void MainWindow::processCapture()\n \tfps = lastBufferTime_ && fps ? 1000000000.0 / fps : 0.0;\n \tlastBufferTime_ = metadata.timestamp;\n \n-\tqInfo() << \"seq:\" << qSetFieldWidth(6) << qSetPadChar('0')\n-\t\t<< metadata.sequence << reset\n+\tqInfo().noquote()\n+\t\t<< QString(\"seq: %1\").arg(metadata.sequence, 6, 10, QLatin1Char('0'))\n \t\t<< \"bytesused:\" << metadata.planes[0].bytesused\n \t\t<< \"timestamp:\" << metadata.timestamp\n \t\t<< \"fps:\" << fixed << qSetRealNumberPrecision(2) << fps;\n","prefixes":["libcamera-devel"]}