File: main.cpp

package info (click to toggle)
dtkcore 5.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,728 kB
  • sloc: cpp: 22,021; ansic: 183; python: 68; xml: 58; makefile: 27; sh: 15
file content (34 lines) | stat: -rw-r--r-- 931 bytes parent folder | download
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
28
29
30
31
32
33
34
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#include <DLog>
#include <QCoreApplication>
#include <QTimer>

DCORE_USE_NAMESPACE

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);
#ifdef Q_OS_LINUX
    DLogManager::registerJournalAppender();
#endif
    DLogManager::registerConsoleAppender();
    dDebug() << "Anything that can possibly go wrong, will go wrong. ";
    qWarning() << "FBI Warning: Code smells.";
    qInfo() << "Why dark mode? Because light attracts bugs";
    qCritical() << "You Should Never Run `sudo rm -rf /`";

    {
        dDebugTime("Test the running time of a code block");
        QTimer timer;
        timer.setInterval(500);
        QEventLoop loop;
        QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
        timer.start();
        loop.exec();
    }

    return app.exec();
}