From 211d6f5ca6adfa5d90a73e753d17478123ba887f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 30 Aug 2021 02:44:21 +0300 Subject: libcamera: media_device: Print link information when setup fails When setting up a link fails, the error message doesn't specify which link is being acted on. This makes debugging more difficult than it should be. Improve the message by printing the link information. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/media_device.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index ccaf039b..aa93da75 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -803,7 +803,11 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags) if (ret) { ret = -errno; LOG(MediaDevice, Error) - << "Failed to setup link: " + << "Failed to setup link " + << source->entity()->name() << "[" + << source->index() << "] -> " + << sink->entity()->name() << "[" + << sink->index() << "]: " << strerror(-ret); return ret; } -- cgit v1.2.1