{"id":311,"url":"https://patchwork.libcamera.org/api/1.1/covers/311/?format=json","web_url":"https://patchwork.libcamera.org/cover/311/","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":"<20190121195606.8526-1-laurent.pinchart@ideasonboard.com>","date":"2019-01-21T19:56:02","name":"[libcamera-devel,v2,0/4] Extend the logger with categories and configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/311/mbox/","series":[{"id":108,"url":"https://patchwork.libcamera.org/api/1.1/series/108/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=108","date":"2019-01-21T19:56:02","name":"Extend the logger with categories and configuration","version":2,"mbox":"https://patchwork.libcamera.org/series/108/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/311/comments/","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BCEB360C80\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 20:56:11 +0100 (CET)","from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 41A6853E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 20:56:11 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548100571;\n\tbh=MEDWbrLHz/VVOur77hno6YCYxVHH0uxhO3ncyICJ0c8=;\n\th=From:To:Subject:Date:From;\n\tb=ad86dr6zjoxphHyg85VDhn0DugYScgR+mUt8A69kiLaKaPx6m3v1UeQ8yUnjH7+rb\n\tefDzoVnU+AMZE1K5UEE2Pdm39zvtxtV5f4VZENj83DbkpJaS6HwMiECdPM4LlIQdvO\n\tFfoTcMvWhqtsJhTOf2XfDWTveiyOaes9dZhw4ryY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 21 Jan 2019 21:56:02 +0200","Message-Id":"<20190121195606.8526-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.19.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 0/4] Extend the logger with categories\n\tand configuration","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":"Mon, 21 Jan 2019 19:56:11 -0000"},"content":"Hello,\n\nThis patch series extends the logging infrastructure with support for\nlogging categories, and implements configuration of the logger from\nenvironment variables.\n\nPatch 1/4 adds log categories, patch 2/4 and 3/4 configure log levels\nand the log output file from environment variables, and patch 4/4 makes\nuses of categories through the code base.\n\nCompared to v1, two merged patches have been dropped, and the LOG() and\nLOG() macros have been merged together, with the documentation updated\naccordingly.\n\nAs with v1, I'm not entirely happy with the following:\n\n- I would like the LOG() macro to automatically log to the category\n  defined with LOG_DEFINE_CATEGORY() (or declared with\n  LOG_DECLARE_CATEGORY()) when used without an explicit category and\n  when the compilation unit has a single category declared (or possibly\n  the first or last category declared when there are several). I haven't\n  found a good way to implement this, it is still an exercise for the\n  reader.\n\n- A test case for log environment variables parsing would be nice, but\n  that's hard to do as the implementation is very private.\n\n- Patch 4/4 heavily violates checkstyle.py, and after digging into the\n  astyle options I unfortunately found out that the indentation for this\n  specific case is hardcoded. However, the new clang-format support for\n  checkstyle.py doesn't complain, so I'm enclined to leave it as-is.\n\n- Documenting the LOG() macro properly and hiding the internal macros\n  from log.h without any doxygen warning required adding a #ifndef\n  __DOXYGEN__ in log.h, which I don't like much.\n\nI don't think any of those issues are blockers, so I plan to push the\npatches to the master branch soon.\n\nLaurent Pinchart (4):\n  libcamera: log: Add log categories\n  libcamera: log: Get log levels from the environment\n  libcamera: log: Get log output file from the environment\n  libcamera: Use log categories\n\n Documentation/Doxyfile.in               |   2 +-\n src/libcamera/camera_manager.cpp        |  14 +-\n src/libcamera/device_enumerator.cpp     |  25 +-\n src/libcamera/event_dispatcher.cpp      |   4 +\n src/libcamera/event_dispatcher_poll.cpp |  28 +-\n src/libcamera/include/log.h             |  56 ++-\n src/libcamera/log.cpp                   | 436 ++++++++++++++++++++++--\n src/libcamera/media_device.cpp          |  52 +--\n src/libcamera/media_object.cpp          |   7 +-\n src/libcamera/pipeline_handler.cpp      |   5 +-\n src/libcamera/timer.cpp                 |   7 +-\n src/libcamera/v4l2_device.cpp           |  25 +-\n 12 files changed, 561 insertions(+), 100 deletions(-)"}