[{"id":207,"web_url":"https://patchwork.libcamera.org/comment/207/","msgid":"<20190106113439.GD11987@bigcity.dyn.berto.se>","date":"2019-01-06T11:34:39","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: log: Pad timestamp\n\tfields with zeros","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 2019-01-06 04:33:20 +0200, Laurent Pinchart wrote:\n> The logger prints the timestamp fields with a fixed width, but pads them\n> with spaces instead of zeros. Fix this.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/log.cpp | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\n> index 4165cbd654fc..e4d07fbbea3b 100644\n> --- a/src/libcamera/log.cpp\n> +++ b/src/libcamera/log.cpp\n> @@ -101,10 +101,12 @@ LogMessage::LogMessage(const char *fileName, unsigned int line,\n>  \t/* Log the timestamp, severity and file information. */\n>  \tstruct timespec timestamp;\n>  \tclock_gettime(CLOCK_MONOTONIC, &timestamp);\n> +\tmsgStream.fill('0');\n>  \tmsgStream << \"[\" << timestamp.tv_sec / (60 * 60) << \":\"\n>  \t\t  << std::setw(2) << (timestamp.tv_sec / 60) % 60 << \":\"\n>  \t\t  << std::setw(2) << timestamp.tv_sec % 60 << \".\"\n>  \t\t  << std::setw(9) << timestamp.tv_nsec << \"]\";\n> +\tmsgStream.fill(' ');\n\nprintf() the feature I miss the most :-)\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n>  \n>  \tmsgStream << \" \" << log_severity_name(severity);\n>  \tmsgStream << \" \" << basename(fileName) << \":\" << line << \" \";\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-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 344EC60B2C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  6 Jan 2019 12:34:41 +0100 (CET)","by mail-lf1-x144.google.com with SMTP id l10so28221691lfh.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 06 Jan 2019 03:34:41 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tq128-v6sm7998681ljq.14.2019.01.06.03.34.39\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 06 Jan 2019 03:34:39 -0800 (PST)"],"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\t:user-agent; bh=m5UsfLe3cL94DvHDSZXHP/vCg67nRhWLWEUNAENebW8=;\n\tb=BJlehH4CJWmJXx8B/OUrTxrnrQFOnHEox2MNt++bfloND75aGW5cilI7ThYNs+v3tr\n\tccvIe6hgIC757mV1DFEq3YlGHpv9zmUJPa44kKP0jgqGKs5kMr3qA0Ih+6e1iP0uLJFU\n\tDTOFnDlglVzcX1M85/K0yeIXm5cUPgrOiZkprpzcHhXblyb4eqcRXlIzKm/OwvtGJoi/\n\tvOH10SXpHFrRGUBxMu3dSklnc+v4lS99wskY/j/GsV1TnFAotKvsB/GVMtjAegg30wVn\n\txkb0cKhIXpkmxZ0tMiwSaarKDduM1AnHYbl4Dj/yrsKglWKri2HsWqGCpcD8ohntM10i\n\t9MGQ==","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:user-agent;\n\tbh=m5UsfLe3cL94DvHDSZXHP/vCg67nRhWLWEUNAENebW8=;\n\tb=mX3GjuYV/2Zv0DuP0Ohx/gjcqeg8ZBOS9mkJ/G4Q3sSiI0heAYiRS5ZQINb2VQMpvK\n\tjEYbH4KDr8J8VravQ4ehqSSQvRRQWh9sqUp5lJRCJ8zXnzOm0LtzFYZjErFlf9JTrO6G\n\tpwRwKf8o8W4fOxV4wgf5uNWISSoS8iorbZWvlUybuV+pIityu+5SYzdxSqlgUzu9qedI\n\twbv4lR5k3KKz59wvDzTBu964v9WFXcM8YG1PfRawkQErIZdyBqoYzP87Yd74h7lAqPF3\n\tJL3cVL/s0oc7iNyh8YlS+JHvBEE1qqjBBkJaMXI5HF3wxhkBoXdeNR1owTzhekiPPTMp\n\tIRwQ==","X-Gm-Message-State":"AA+aEWZDcQh7UQGh44KoGB9zHqcDdEUliqAnoDp/QoVIViF/k1my4M1W\n\tESzP7anKMPQJkeKAhewx3LkaxQ==","X-Google-Smtp-Source":"AFSGD/UnLtcPifEhGSpC4hKws4WKpu9Lc8jBgxIvX/6cJDJHocKZGziUM5D9F7mXMjeoeSYxobynTw==","X-Received":"by 2002:a19:ced3:: with SMTP id\n\te202mr28117232lfg.13.1546774480481; \n\tSun, 06 Jan 2019 03:34:40 -0800 (PST)","Date":"Sun, 6 Jan 2019 12:34:39 +0100","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":"<20190106113439.GD11987@bigcity.dyn.berto.se>","References":"<20190106023328.10989-1-laurent.pinchart@ideasonboard.com>\n\t<20190106023328.10989-3-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":"<20190106023328.10989-3-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: log: Pad timestamp\n\tfields with zeros","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Sun, 06 Jan 2019 11:34:41 -0000"}}]