Files
external_libcamera/src/apps/qcam/message_handler.cpp
Laurent Pinchart 84ad104499 Move test applications to src/apps/
The cam and qcam test application share code, currently through a crude
hack that references the cam source files directly from the qcam
meson.build file. To prepare for the introduction of hosting that code
in a static library, move all applications to src/apps/.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-20 13:36:25 +03:00

28 lines
654 B
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2020, Laurent Pinchart <laurent.pinchart@ideasonboard.com>
*
* message_handler.cpp - qcam - Log message handling
*/
#include "message_handler.h"
QtMessageHandler MessageHandler::handler_ = nullptr;
bool MessageHandler::verbose_ = false;
MessageHandler::MessageHandler(bool verbose)
{
verbose_ = verbose;
handler_ = qInstallMessageHandler(&MessageHandler::handleMessage);
}
void MessageHandler::handleMessage(QtMsgType type,
const QMessageLogContext &context,
const QString &msg)
{
if (type == QtDebugMsg && !verbose_)
return;
handler_(type, context, msg);
}