File indexing completed on 2024-06-16 04:50:17

0001 /*
0002     SPDX-FileCopyrightText: 2018 Daniel Vrátil <dvratil@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "shared/akremotelog.h"
0008 
0009 #include <QCoreApplication>
0010 #include <QThread>
0011 #include <QTimer>
0012 
0013 namespace
0014 {
0015 const auto initRemoteLogger = []() {
0016     qAddPreRoutine([]() {
0017         // Initialize remote logging from event loop, this way applications like
0018         // Akonadi Console or TestRunner have a chance to change AKONADI_INSTANCE
0019         // before the RemoteLog class initialize
0020         QTimer::singleShot(0, qApp, []() {
0021             akInitRemoteLog();
0022         });
0023     });
0024     return true;
0025 }();
0026 
0027 } // namespace