Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/logger/DebugLogger.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Malte Veerman <malte.veerman@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License or (at your option) version 3 or any later version | ||||
8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | * defined in Section 14 of version 3 of the license. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | #include "DebugLogger.h" | ||||
22 | | ||||
23 | #include "core/support/Debug.h" | ||||
24 | | ||||
25 | | ||||
26 | DebugLogger::DebugLogger( QObject *parent ) | ||||
27 | : QObject( parent ) | ||||
28 | { | ||||
29 | DEBUG_BLOCK | ||||
30 | } | ||||
31 | | ||||
32 | void DebugLogger::shortMessageImpl( const QString& text ) | ||||
33 | { | ||||
34 | DEBUG_BLOCK | ||||
35 | | ||||
36 | debug() << "Short message:" << text; | ||||
37 | } | ||||
38 | | ||||
39 | void DebugLogger::longMessageImpl( const QString& text, Amarok::Logger::MessageType type ) | ||||
40 | { | ||||
41 | DEBUG_BLOCK | ||||
42 | | ||||
43 | debug() << "Long message:" << text << type; | ||||
44 | } | ||||
45 | | ||||
46 | void DebugLogger::newProgressOperationImpl( QObject* sender, const QMetaMethod& increment, const QMetaMethod& end, const QString& text, int maximum, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) | ||||
47 | { | ||||
48 | Q_UNUSED( increment ) | ||||
49 | Q_UNUSED( end ) | ||||
50 | | ||||
51 | DEBUG_BLOCK | ||||
52 | | ||||
53 | debug() << "New progress operation with generic QObject:" << sender; | ||||
54 | debug() << "Text:" << text; | ||||
55 | debug() << "Maximum:" << maximum; | ||||
56 | debug() << "Object to call when canceled:" << context; | ||||
57 | debug() << "Member function to call when canceled:" << function.target_type().name(); | ||||
58 | debug() << "Connection type:" << type; | ||||
59 | } | ||||
60 | | ||||
61 | void DebugLogger::newProgressOperationImpl( QNetworkReply* reply, const QString& text, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) | ||||
62 | { | ||||
63 | DEBUG_BLOCK | ||||
64 | | ||||
65 | debug() << "New progress operation with QNetworkReply:" << reply; | ||||
66 | debug() << "Text:" << text; | ||||
67 | debug() << "Object to call when canceled:" << context; | ||||
68 | debug() << "Member function to call when canceled:" << function.target_type().name(); | ||||
69 | debug() << "Connection type:" << type; | ||||
70 | } | ||||
71 | | ||||
72 | void DebugLogger::newProgressOperationImpl( KJob* job, const QString& text, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) | ||||
73 | { | ||||
74 | DEBUG_BLOCK | ||||
75 | | ||||
76 | debug() << "New progress operation with KJob:" << job; | ||||
77 | debug() << "Text:" << text; | ||||
78 | debug() << "Object to call when canceled:" << context; | ||||
79 | debug() << "Member function to call when canceled:" << function.target_type().name(); | ||||
80 | debug() << "Connection type:" << type; | ||||
81 | } |