blob: c89714a9e6f08f4716fe0c80b453852f31f30a6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2020, Laurent Pinchart <laurent.pinchart@ideasonboard.com>
*
* 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);
}
|