[PATCH] libcamera: camera: Log info message to report camera creation

Barnabás Pőcze barnabas.pocze at ideasonboard.com
Mon Mar 3 14:10:38 CET 2025


Hi


2025. 02. 26. 1:55 keltezéssel, Laurent Pinchart írta:
> Camera creation is one of the most important events generated by
> libcamera, but we are completely silent about it. The lack of a log
> message makes it more difficult to identify problems and provide
> support. Fix it by adding an Info message that reports the camera id and
> its pipeline handler when the camera is created.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>   src/libcamera/camera.cpp | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 56c5851993c9..35097bfdafa2 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -862,6 +862,10 @@ std::shared_ptr<Camera> Camera::create(std::unique_ptr<Private> d,
>   		}
>   	};
> 
> +	LOG(Camera, Info)
> +		<< "Creating camera '" << id << "' for pipeline handler "
> +		<< d->pipe_->name();
> +

I have a similar change locally but it adds log messages to `CameraManager::{add,remove}Camera()`,
not sure which is the better place, but I think the removal also deserves at
least a "Debug" message. I am also wondering if the "Info" level is not too high?


Regards,
Barnabás Pőcze


>   	Camera *camera = new Camera(std::move(d), id, streams);
> 
>   	return std::shared_ptr<Camera>(camera, Deleter());
> 
> base-commit: 33ce463a46c44f874fdbc3e484bee730e7b251a3
> --
> Regards,
> 
> Laurent Pinchart
> 



More information about the libcamera-devel mailing list