[{"id":4655,"web_url":"https://patchwork.libcamera.org/comment/4655/","msgid":"<20200430004659.GA1752267@oden.dyn.berto.se>","date":"2020-04-30T00:46:59","subject":"Re: [libcamera-devel] [PATCH] qcam: Fix logging of sequence number","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-04-29 22:31:56 +0300, Laurent Pinchart wrote:\n> The sequence number of captured frames is logged to the console with\n> padding to 6 characters to increase readability. The output is however\n> incorrect, as 123 is printed as 00012300000. This is caused by the\n> auto-space feature of QDebug, which inserts a space after every field.\n> This doesn't play well with stream format manipulation, as it ends up\n> padding the automatically inserted space the same way as the previous\n> argument.\n> \n> This is a bug in Qt, work around it by formatting the sequence number\n> manually.\n> \n> Fixes: 494da4467ddf (\"qcam: Use Qt qInfo() and qWarning() logging facilities\")\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/qcam/main_window.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\n> index 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> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 698006041C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Apr 2020 02:47:01 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id j14so3282320lfg.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Apr 2020 17:47:01 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tw19sm3481401ljo.54.2020.04.29.17.46.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 29 Apr 2020 17:47:00 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"HPb323C9\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=DA2uAkJe9CIJE0vWYx2OW4PhsrT6L2rrrOWEPXdnSuA=;\n\tb=HPb323C99lhs1X0iHW4+1Xz8lhdN79RnH92Ro3sUg+WkrBWARjuC+8yyeueRGVraso\n\tCSvx6goix/l2cY3o8FAuEWdHpwxZuRlLdPO7gXX9SKdOIk+6yB1G9U+Rb+CwUZl8aqEO\n\tjQv4+FDBGRAVQvcUN9qTdVeWHN9AlmJcU9WYAT7nDxYkVDES4RFUFNrw9Xsl22LwgzDZ\n\tbIFZXBZnr9Epv4cXWkYzECbnDsEHI7jB2FlrgKo8WFIWRQfJcsWhVoiJp1QziGJpD2OW\n\t74pW2uW/hK4uBvv8gwWmy7FnUotzOcOkCDzrlYZUMgdjTH4mzh3KCxHdbnkohjUW4gzF\n\tougQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=DA2uAkJe9CIJE0vWYx2OW4PhsrT6L2rrrOWEPXdnSuA=;\n\tb=cujRKUL2j1kw1EMizzS81ljN7lG56OY2SN3FfRqYPb05ZzblXD+RI2BVXBIswletVo\n\tj4gbZGxpOApbLsihnszo/EPUCJCzkx68lW9v8d8Mw2r78YA0kpZAACT0nnmSTM0+k0o/\n\t7eL77fFD+i01xsOM/T/syD8Et+hiInm9ToAvPeugg9U9Tg681EzqyVh0b3yK3vix1a8y\n\tETXdZPub7e8AbxG9jDS+l9lQez5DCUzrjIoF+Y0jd60raWn6HTb2JLrbJhiZ4ojVrXqV\n\tXd+94jRMhnjPYIpoE+V1fYuiR5aZBM77QYATt9dRT1LahSmtLB7Kd0VoT2+9knn7a13T\n\to0XQ==","X-Gm-Message-State":"AGi0PuY1ged8Rryq/AM+TBMhfSosLGcxpnUeRcJad64ulBxxwMSkkGQw\n\tLHvrVNjG31epPn2TzlV5Q393hSrjZF0=","X-Google-Smtp-Source":"APiQypKIARy/ACeuYWncPn1QVyVuT4ngsYX4Bq6iGyS8oLHj6pK2px8DblJp1u5ws8l6p414GVBdAQ==","X-Received":"by 2002:a19:3848:: with SMTP id d8mr323743lfj.44.1588207620599; \n\tWed, 29 Apr 2020 17:47:00 -0700 (PDT)","Date":"Thu, 30 Apr 2020 02:46:59 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200430004659.GA1752267@oden.dyn.berto.se>","References":"<20200429193156.28041-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200429193156.28041-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [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":"Thu, 30 Apr 2020 00:47:01 -0000"}}]