{"id":286,"url":"https://patchwork.libcamera.org/api/1.1/patches/286/?format=json","web_url":"https://patchwork.libcamera.org/patch/286/","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":"<20190121005930.10112-7-laurent.pinchart@ideasonboard.com>","date":"2019-01-21T00:59:30","name":"[libcamera-devel,6/6] libcamera: Use log categories","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"9e7f84ca3cf7751d26d7bdf392970ebda06e5d9f","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/286/mbox/","series":[{"id":96,"url":"https://patchwork.libcamera.org/api/1.1/series/96/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=96","date":"2019-01-21T00:59:24","name":"Extend the logger with categories and configuration","version":1,"mbox":"https://patchwork.libcamera.org/series/96/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/286/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/286/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 A316360CA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 01:59:36 +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 3A14BD6C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 01:59:36 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548032376;\n\tbh=W4TNRPJjGe2m171Wr95ZskWWtBs9asvIaKg/wUicXtg=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=V+lZUm+PD4WK5HVY+9FbirkBoZUrKGDQw6x+AKjN2hVAC0hyf/z1yZrV+y0tZ9PiI\n\tQHkCFeeyYyPN7cH83jwi9f41WgGcHUR9PI6uZRIOedQz83jd3k4HkUiQmL+3gXleDa\n\tItf8Y8YIJoaSgsSxeowYFr6dFNudGofVa6hHO5mY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 21 Jan 2019 02:59:30 +0200","Message-Id":"<20190121005930.10112-7-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.19.2","In-Reply-To":"<20190121005930.10112-1-laurent.pinchart@ideasonboard.com>","References":"<20190121005930.10112-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 6/6] libcamera: Use log categories","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 00:59:37 -0000"},"content":"Use log categories in all the existing code base.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\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/media_device.cpp          | 48 ++++++++++++++-----------\n src/libcamera/media_object.cpp          |  7 ++--\n src/libcamera/pipeline_handler.cpp      |  5 ++-\n src/libcamera/timer.cpp                 |  6 ++--\n src/libcamera/v4l2_device.cpp           | 25 +++++++------\n 9 files changed, 102 insertions(+), 60 deletions(-)","diff":"diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\nindex d76eaa7ace86..f9085f45e331 100644\n--- a/src/libcamera/camera_manager.cpp\n+++ b/src/libcamera/camera_manager.cpp\n@@ -21,6 +21,8 @@\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(Camera)\n+\n /**\n  * \\class CameraManager\n  * \\brief Provide access and manage all cameras in the system\n@@ -101,8 +103,9 @@ int CameraManager::start()\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tLOG(Debug) << \"Pipeline handler \\\"\" << factory->name()\n-\t\t\t\t   << \"\\\" matched\";\n+\t\t\tLOGC(Camera, Debug)\n+\t\t\t\t<< \"Pipeline handler \\\"\" << factory->name()\n+\t\t\t\t<< \"\\\" matched\";\n \t\t\tpipes_.push_back(pipe);\n \t\t}\n \t}\n@@ -176,8 +179,9 @@ void CameraManager::addCamera(std::shared_ptr<Camera> camera)\n {\n \tfor (std::shared_ptr<Camera> c : cameras_) {\n \t\tif (c->name() == camera->name()) {\n-\t\t\tLOG(Warning) << \"Registering camera with duplicate name '\"\n-\t\t\t\t     << camera->name() << \"'\";\n+\t\t\tLOGC(Camera, Warning)\n+\t\t\t\t<< \"Registering camera with duplicate name '\"\n+\t\t\t\t<< camera->name() << \"'\";\n \t\t\tbreak;\n \t\t}\n \t}\n@@ -216,7 +220,7 @@ CameraManager *CameraManager::instance()\n void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher)\n {\n \tif (dispatcher_) {\n-\t\tLOG(Warning) << \"Event dispatcher is already set\";\n+\t\tLOGC(Camera, Warning) << \"Event dispatcher is already set\";\n \t\treturn;\n \t}\n \ndiff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\nindex 55c510e3b79a..c2493e921e87 100644\n--- a/src/libcamera/device_enumerator.cpp\n+++ b/src/libcamera/device_enumerator.cpp\n@@ -42,6 +42,8 @@\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(DeviceEnumerator)\n+\n /**\n  * \\class DeviceMatch\n  * \\brief Description of a media device search pattern\n@@ -155,7 +157,8 @@ DeviceEnumerator::~DeviceEnumerator()\n {\n \tfor (MediaDevice *dev : devices_) {\n \t\tif (dev->busy())\n-\t\t\tLOG(Error) << \"Removing media device while still in use\";\n+\t\t\tLOGC(DeviceEnumerator, Error)\n+\t\t\t\t<< \"Removing media device while still in use\";\n \n \t\tdelete dev;\n \t}\n@@ -205,13 +208,15 @@ int DeviceEnumerator::addDevice(const std::string &devnode)\n \n \tret = media->populate();\n \tif (ret < 0) {\n-\t\tLOG(Info) << \"Unable to populate media device \" << devnode <<\n-\t\t\t  \" (\" << strerror(-ret) << \"), skipping\";\n+\t\tLOGC(DeviceEnumerator, Info)\n+\t\t\t<< \"Unable to populate media device \" << devnode\n+\t\t\t<< \" (\" << strerror(-ret) << \"), skipping\";\n \t\treturn ret;\n \t}\n \n-\tLOG(Debug) << \"New media device \\\"\" << media->driver()\n-\t\t   << \"\\\" created from \" << devnode;\n+\tLOGC(DeviceEnumerator, Debug)\n+\t\t<< \"New media device \\\"\" << media->driver()\n+\t\t<< \"\\\" created from \" << devnode;\n \n \t/* Associate entities to device node paths. */\n \tfor (MediaEntity *entity : media->entities()) {\n@@ -251,8 +256,9 @@ MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm)\n \t\t\tcontinue;\n \n \t\tif (dm.match(dev)) {\n-\t\t\tLOG(Debug) << \"Successful match for media device \\\"\"\n-\t\t\t\t   << dev->driver() << \"\\\"\";\n+\t\t\tLOGC(DeviceEnumerator, Debug)\n+\t\t\t\t<< \"Successful match for media device \\\"\"\n+\t\t\t\t<< dev->driver() << \"\\\"\";\n \t\t\treturn dev;\n \t\t}\n \t}\n@@ -330,8 +336,9 @@ int DeviceEnumeratorUdev::enumerate()\n \n \t\tdev = udev_device_new_from_syspath(udev_, syspath);\n \t\tif (!dev) {\n-\t\t\tLOG(Warning) << \"Failed to get device for '\" <<\n-\t\t\t\tsyspath << \"', skipping\";\n+\t\t\tLOGC(DeviceEnumerator, Warning)\n+\t\t\t\t<< \"Failed to get device for '\"\n+\t\t\t\t<< syspath << \"', skipping\";\n \t\t\tcontinue;\n \t\t}\n \ndiff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera/event_dispatcher.cpp\nindex 5462730214d6..f7c40734095e 100644\n--- a/src/libcamera/event_dispatcher.cpp\n+++ b/src/libcamera/event_dispatcher.cpp\n@@ -7,12 +7,16 @@\n \n #include <libcamera/event_dispatcher.h>\n \n+#include \"log.h\"\n+\n /**\n  * \\file event_dispatcher.h\n  */\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(Event)\n+\n /**\n  * \\class EventDispatcher\n  * \\brief Interface to manage the libcamera events and timers\ndiff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp\nindex 2072ae0aa3da..14e98a788909 100644\n--- a/src/libcamera/event_dispatcher_poll.cpp\n+++ b/src/libcamera/event_dispatcher_poll.cpp\n@@ -22,6 +22,8 @@\n \n namespace libcamera {\n \n+LOG_DECLARE_CATEGORY(Event)\n+\n static const char *notifierType(EventNotifier::Type type)\n {\n \tif (type == EventNotifier::Read)\n@@ -53,8 +55,9 @@ void EventDispatcherPoll::registerEventNotifier(EventNotifier *notifier)\n \tEventNotifier::Type type = notifier->type();\n \n \tif (set.notifiers[type] && set.notifiers[type] != notifier) {\n-\t\tLOG(Warning) << \"Ignoring duplicate \" << notifierType(type)\n-\t\t\t     << \" notifier for fd \" << notifier->fd();\n+\t\tLOGC(Event, Warning)\n+\t\t\t<< \"Ignoring duplicate \" << notifierType(type)\n+\t\t\t<< \" notifier for fd \" << notifier->fd();\n \t\treturn;\n \t}\n \n@@ -74,8 +77,9 @@ void EventDispatcherPoll::unregisterEventNotifier(EventNotifier *notifier)\n \t\treturn;\n \n \tif (set.notifiers[type] != notifier) {\n-\t\tLOG(Warning) << notifierType(type) << \" notifier for fd \"\n-\t\t\t     << notifier->fd() << \" is not registered\";\n+\t\tLOGC(Event, Warning)\n+\t\t\t<< notifierType(type) << \" notifier for fd \"\n+\t\t\t<< notifier->fd() << \" is not registered\";\n \t\treturn;\n \t}\n \n@@ -141,9 +145,10 @@ void EventDispatcherPoll::processEvents()\n \t\t\ttimeout.tv_nsec = 0;\n \t\t}\n \n-\t\tLOG(Debug) << \"timeout \" << timeout.tv_sec << \".\"\n-\t\t\t   << std::setfill('0') << std::setw(9)\n-\t\t\t   << timeout.tv_nsec;\n+\t\tLOGC(Event, Debug)\n+\t\t\t<< \"timeout \" << timeout.tv_sec << \".\"\n+\t\t\t<< std::setfill('0') << std::setw(9)\n+\t\t\t<< timeout.tv_nsec;\n \t}\n \n \t/* Wait for events and process notifiers and timers. */\n@@ -151,7 +156,7 @@ void EventDispatcherPoll::processEvents()\n \t\t    nextTimer ? &timeout : nullptr, nullptr);\n \tif (ret < 0) {\n \t\tret = -errno;\n-\t\tLOG(Warning) << \"poll() failed with \" << strerror(-ret);\n+\t\tLOGC(Event, Warning) << \"poll() failed with \" << strerror(-ret);\n \t} else if (ret > 0) {\n \t\tprocessNotifiers(pollfds);\n \t}\n@@ -201,9 +206,10 @@ void EventDispatcherPoll::processNotifiers(const std::vector<struct pollfd> &pol\n \t\t\t * notifier immediately.\n \t\t\t */\n \t\t\tif (pfd.revents & POLLNVAL) {\n-\t\t\t\tLOG(Warning) << \"Disabling \" << notifierType(event.type)\n-\t\t\t\t\t     << \" due to invalid file descriptor \"\n-\t\t\t\t\t     << pfd.fd;\n+\t\t\t\tLOGC(Event, Warning)\n+\t\t\t\t\t<< \"Disabling \" << notifierType(event.type)\n+\t\t\t\t\t<< \" due to invalid file descriptor \"\n+\t\t\t\t\t<< pfd.fd;\n \t\t\t\tunregisterEventNotifier(notifier);\n \t\t\t\tcontinue;\n \t\t\t}\ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex 0ee55060aa9b..3f431accfc69 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -27,6 +27,8 @@\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(MediaDevice)\n+\n /**\n  * \\class MediaDevice\n  * \\brief The MediaDevice represents a Media Controller device with its full\n@@ -139,15 +141,15 @@ bool MediaDevice::acquire()\n int MediaDevice::open()\n {\n \tif (fd_ != -1) {\n-\t\tLOG(Error) << \"MediaDevice already open\";\n+\t\tLOGC(MediaDevice, Error) << \"MediaDevice already open\";\n \t\treturn -EBUSY;\n \t}\n \n \tint ret = ::open(devnode_.c_str(), O_RDWR);\n \tif (ret < 0) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Failed to open media device at \" << devnode_\n-\t\t\t   << \": \" << strerror(-ret);\n+\t\tLOGC(MediaDevice, Error) << \"Failed to open media device at \"\n+\t\t\t<< devnode_ << \": \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \tfd_ = ret;\n@@ -156,8 +158,8 @@ int MediaDevice::open()\n \tret = ioctl(fd_, MEDIA_IOC_DEVICE_INFO, &info);\n \tif (ret) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Failed to get media device info \"\n-\t\t\t   << \": \" << strerror(-ret);\n+\t\tLOGC(MediaDevice, Error) << \"Failed to get media device info \"\n+\t\t\t<< \": \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \n@@ -227,8 +229,9 @@ int MediaDevice::populate()\n \t\tret = ioctl(fd_, MEDIA_IOC_G_TOPOLOGY, &topology);\n \t\tif (ret < 0) {\n \t\t\tret = -errno;\n-\t\t\tLOG(Error) << \"Failed to enumerate topology: \"\n-\t\t\t\t   << strerror(-ret);\n+\t\t\tLOGC(MediaDevice, Error)\n+\t\t\t\t<< \"Failed to enumerate topology: \"\n+\t\t\t\t<< strerror(-ret);\n \t\t\treturn ret;\n \t\t}\n \n@@ -445,8 +448,8 @@ bool MediaDevice::addObject(MediaObject *object)\n {\n \n \tif (objects_.find(object->id()) != objects_.end()) {\n-\t\tLOG(Error) << \"Element with id \" << object->id()\n-\t\t\t   << \" already enumerated.\";\n+\t\tLOGC(MediaDevice, Error) << \"Element with id \" << object->id()\n+\t\t\t<< \" already enumerated.\";\n \t\treturn false;\n \t}\n \n@@ -568,8 +571,9 @@ bool MediaDevice::populatePads(const struct media_v2_topology &topology)\n \t\tMediaEntity *mediaEntity = dynamic_cast<MediaEntity *>\n \t\t\t\t\t   (object(entity_id));\n \t\tif (!mediaEntity) {\n-\t\t\tLOG(Error) << \"Failed to find entity with id: \"\n-\t\t\t\t   << entity_id;\n+\t\t\tLOGC(MediaDevice, Error)\n+\t\t\t\t<< \"Failed to find entity with id: \"\n+\t\t\t\t<< entity_id;\n \t\t\treturn false;\n \t\t}\n \n@@ -604,8 +608,9 @@ bool MediaDevice::populateLinks(const struct media_v2_topology &topology)\n \t\tMediaPad *source = dynamic_cast<MediaPad *>\n \t\t\t\t   (object(source_id));\n \t\tif (!source) {\n-\t\t\tLOG(Error) << \"Failed to find pad with id: \"\n-\t\t\t\t   << source_id;\n+\t\t\tLOGC(MediaDevice, Error)\n+\t\t\t\t<< \"Failed to find pad with id: \"\n+\t\t\t\t<< source_id;\n \t\t\treturn false;\n \t\t}\n \n@@ -613,8 +618,9 @@ bool MediaDevice::populateLinks(const struct media_v2_topology &topology)\n \t\tMediaPad *sink = dynamic_cast<MediaPad *>\n \t\t\t\t (object(sink_id));\n \t\tif (!sink) {\n-\t\t\tLOG(Error) << \"Failed to find pad with id: \"\n-\t\t\t\t   << sink_id;\n+\t\t\tLOGC(MediaDevice, Error)\n+\t\t\t\t<< \"Failed to find pad with id: \"\n+\t\t\t\t<< sink_id;\n \t\t\treturn false;\n \t\t}\n \n@@ -665,14 +671,16 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)\n \tint ret = ioctl(fd_, MEDIA_IOC_SETUP_LINK, &linkDesc);\n \tif (ret) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Failed to setup link: \" << strerror(-ret);\n+\t\tLOGC(MediaDevice, Error) << \"Failed to setup link: \"\n+\t\t\t<< strerror(-ret);\n \t\treturn ret;\n \t}\n \n-\tLOG(Debug) << source->entity()->name() << \"[\"\n-\t\t   << source->index() << \"] -> \"\n-\t\t   << sink->entity()->name() << \"[\"\n-\t\t   << sink->index() << \"]: \" << flags;\n+\tLOGC(MediaDevice, Debug)\n+\t\t<< source->entity()->name() << \"[\"\n+\t\t<< source->index() << \"] -> \"\n+\t\t<< sink->entity()->name() << \"[\"\n+\t\t<< sink->index() << \"]: \" << flags;\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp\nindex cb3af85e217e..70983ba1f257 100644\n--- a/src/libcamera/media_object.cpp\n+++ b/src/libcamera/media_object.cpp\n@@ -39,6 +39,8 @@\n \n namespace libcamera {\n \n+LOG_DECLARE_CATEGORY(MediaDevice)\n+\n /**\n  * \\class MediaObject\n  * \\brief Base class for all media objects\n@@ -317,8 +319,9 @@ int MediaEntity::setDeviceNode(const std::string &devnode)\n \tint ret = ::access(devnode.c_str(), R_OK | W_OK);\n \tif (ret < 0) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Device node \" << devnode << \" can't be accessed: \"\n-\t\t\t   << strerror(-ret);\n+\t\tLOGC(MediaDevice, Error)\n+\t\t\t<< \"Device node \" << devnode << \" can't be accessed: \"\n+\t\t\t<< strerror(-ret);\n \t\treturn ret;\n \t}\n \ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex f2e08a6a7315..33e35791161a 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -24,6 +24,8 @@\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(Pipeline)\n+\n /**\n  * \\class PipelineHandler\n  * \\brief Create and manage cameras based on a set of media devices\n@@ -120,7 +122,8 @@ void PipelineHandlerFactory::registerType(PipelineHandlerFactory *factory)\n \n \tfactories.push_back(factory);\n \n-\tLOG(Debug) << \"Registered pipeline handler \\\"\" << factory->name() << \"\\\"\";\n+\tLOGC(Pipeline, Debug)\n+\t\t<< \"Registered pipeline handler \\\"\" << factory->name() << \"\\\"\";\n }\n \n /**\ndiff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp\nindex 306825fde3c0..849eeba6ca24 100644\n--- a/src/libcamera/timer.cpp\n+++ b/src/libcamera/timer.cpp\n@@ -20,6 +20,8 @@\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(Timer)\n+\n /**\n  * \\class Timer\n  * \\brief Single-shot timer interface\n@@ -54,8 +56,8 @@ void Timer::start(unsigned int msec)\n \tinterval_ = msec;\n \tdeadline_ = tp.tv_sec * 1000000000ULL + tp.tv_nsec + msec * 1000000ULL;\n \n-\tLOG(Debug) << \"Starting timer \" << this << \" with interval \" << msec\n-\t\t   << \": deadline \" << deadline_;\n+\tLOGC(Timer, Debug) << \"Starting timer \" << this << \" with interval \"\n+\t\t\t   << msec << \": deadline \" << deadline_;\n \n \tCameraManager::instance()->eventDispatcher()->registerTimer(this);\n }\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 54b53de37510..17b73de30995 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -20,6 +20,8 @@\n  */\n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(V4L2)\n+\n /**\n  * \\struct V4L2Capability\n  * \\brief struct v4l2_capability object wrapper and helpers\n@@ -106,15 +108,16 @@ int V4L2Device::open()\n \tint ret;\n \n \tif (isOpen()) {\n-\t\tLOG(Error) << \"Device already open\";\n+\t\tLOGC(V4L2, Error) << \"Device already open\";\n \t\treturn -EBUSY;\n \t}\n \n \tret = ::open(devnode_.c_str(), O_RDWR);\n \tif (ret < 0) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Failed to open V4L2 device '\" << devnode_\n-\t\t\t   << \"': \" << strerror(-ret);\n+\t\tLOGC(V4L2, Error)\n+\t\t\t<< \"Failed to open V4L2 device '\" << devnode_\n+\t\t\t<< \"': \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \tfd_ = ret;\n@@ -122,22 +125,24 @@ int V4L2Device::open()\n \tret = ioctl(fd_, VIDIOC_QUERYCAP, &caps_);\n \tif (ret < 0) {\n \t\tret = -errno;\n-\t\tLOG(Error) << \"Failed to query device capabilities: \"\n-\t\t\t   << strerror(-ret);\n+\t\tLOGC(V4L2, Error)\n+\t\t\t<< \"Failed to query device capabilities: \"\n+\t\t\t<< strerror(-ret);\n \t\treturn ret;\n \t}\n \n-\tLOG(Debug) << \"Opened '\" << devnode_ << \"' \"\n-\t\t   << caps_.bus_info() << \": \" << caps_.driver()\n-\t\t   << \": \" << caps_.card();\n+\tLOGC(V4L2, Debug)\n+\t\t<< \"Opened '\" << devnode_ << \"' \"\n+\t\t<< caps_.bus_info() << \": \" << caps_.driver()\n+\t\t<< \": \" << caps_.card();\n \n \tif (!caps_.isCapture() && !caps_.isOutput()) {\n-\t\tLOG(Debug) << \"Device is not a supported type\";\n+\t\tLOGC(V4L2, Debug) << \"Device is not a supported type\";\n \t\treturn -EINVAL;\n \t}\n \n \tif (!caps_.hasStreaming()) {\n-\t\tLOG(Error) << \"Device does not support streaming I/O\";\n+\t\tLOGC(V4L2, Error) << \"Device does not support streaming I/O\";\n \t\treturn -EINVAL;\n \t}\n \n","prefixes":["libcamera-devel","6/6"]}