qcam: Use Qt qInfo() and qWarning() logging facilities
Replace manual usage of std::cout and std::cerr with the Qt logging facilities. This allows redirection log output if needed, and integrates better with Qt. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
+4
-4
@@ -5,11 +5,11 @@
|
||||
* main.cpp - cam - The libcamera swiss army knife
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <libcamera/camera_manager.h>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
void signalHandler(int signal)
|
||||
{
|
||||
std::cout << "Exiting" << std::endl;
|
||||
qInfo() << "Exiting";
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ int main(int argc, char **argv)
|
||||
|
||||
ret = cm->start();
|
||||
if (ret) {
|
||||
std::cout << "Failed to start camera manager: "
|
||||
<< strerror(-ret) << std::endl;
|
||||
qInfo() << "Failed to start camera manager:"
|
||||
<< strerror(-ret);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user