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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2019 Luxoft Sweden AB
** Copyright (C) 2018 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page qtgeniviextras-index.html
\title Qt GENIVI Extras
\keyword QtGeniviExtras
The Qt GENIVI Extras module provides C++ classes for interacting with
services from the \l {https://www.genivi.org/}{GENIVI Automotive Alliance}.
The module contains helper functions to interact with the
Diagnostic Log and Trace (DLT) daemon. This daemon is used on many
automotive systems to catch all logs from different application.
\section1 Getting Started
To include the definitions of the module's classes and functions, use the
following directive:
\code
#include <QtGeniviExtras>
\endcode
To link against the module, add this line to your qmake \c .pro file:
\badcode
QT += geniviextras
\endcode
See \l {Qt DLT Declarations} for more information about how to use the DLT API.
\section1 Reference
\list
\li \l {Qt GENIVI Extras C++ Classes}{C++ Classes}
\li \l {Qt GENIVI Extras Examples}{Examples}
\endlist
*/
/*!
\module QtGeniviExtras
\title Qt GENIVI Extras C++ Classes
\ingroup modules
\qtvariable geniviextras
\brief C++ classes for the Qt GENIVI Extras API.
The Qt GENIVI Extras C++ API provides functions to interact with GENIVI services.
\section1 Headers
\annotatedlist geniviextras_headers
*/
/*!
\headerfile <QtDlt>
\title Qt DLT Declarations
\ingroup geniviextras_headers
\inmodule QtGeniviExtras
\brief The <QtDlt> header file includes macros to register with a
dlt-daemon and map \l {QLoggingCategory}{QLoggingCategories} to dlt contexts.
\section1 GENIVI DLT
GENIVI DLT is a logging system for automotive. It consists of two applications;
a logging daemon (dlt-daemon) to collect logs of various applications and the linux system,
and a viewer application (dlt-viewer) that runs on the host and can connect to targets running a dlt-daemon.
The dlt-daemon can be configured to log to a file, or forward logs to another dlt-daemon in the
multiple ECU case. For further information about the dlt-daemon, see the dlt-daemon
\l {https://at.projects.genivi.org/wiki/display/PROJ/Diagnostic+Log+and+Trace} {documentation}.
\section2 DLT Applications, Contexts, and Log Level
Every application that wants to log to the dlt-daemon needs to register itself.
Applications are identified by a four characters long identifier and a longer description for the dlt-viewer.
Every registered application can register multiple dlt contexts, which consist of a four characters long
identifier and a comprehensive description.
Every dlt context has a current log level, which defines which logs are forwarded to the dlt-daemon or are
discarded already in the application.
\section2 Controlling the dlt-daemon
The dlt-daemon is controlled by the dlt-viewer running on a host machine. The dlt-viewer can see all the
applications that are registered to the dlt-daemon, along with their contexts and current log levels.
All logs are forwarded from the dlt-daemon to the connected dlt-viewer, and can be filtered and exported.
In addition, the dlt-viewer can send so called "control messages" to the dlt-daemon to change the log level of
a dlt context. Beginning with dlt-daemon version 2.12, these "control messages" are also forwarded to the logging
application and is parsed by Qt to also set the matching log level of the registered QLoggingCategory.
\section1 Qt Message Type Mapping
\target QDLTMessageTypeMapping
As the DLT system isn't a one to one match to the Qt Categorized Logging system, a mapping of the log levels is needed.
With DLT, it's not possible to only enable a specific message type of a QLoggingCategory as DLT only defines the maximum
log level. Because of this limitation all lower message types are automatically enabled once a dlt contexts log level is changed.
The following mapping is used for logging to DLT:
\table
\header \li Qt Message Type \li DLT log level
\row \li QtDebugMsg \li DLT_LOG_DEBUG
\row \li QtInfoMsg \li DLT_LOG_INFO
\row \li QtWarningMsg \li DLT_LOG_WARN
\row \li QtCriticalMsg \li DLT_LOG_ERROR
\row \li QtFatalMsg \li DLT_LOG_FATAL
\row \li No message type enabled \li DLT_LOG_OFF
\endtable
Changing the log level using dlt-viewer enables the following message types:
\table
\header \li DLT log level \li Qt Message Types
\row \li DLT_LOG_VERBOSE \li QtDebugMsg QtInfoMsg QtWarningMsg QtCriticalMsg QtFatalMsg
\row \li DLT_LOG_INFO \li QtDebugMsg QtInfoMsg QtWarningMsg QtCriticalMsg QtFatalMsg
\row \li DLT_LOG_DEBUG \li QtInfoMsg QtWarningMsg QtCriticalMsg QtFatalMsg
\row \li DLT_LOG_WARN \li QtWarningMsg QtCriticalMsg QtFatalMsg
\row \li DLT_LOG_ERROR \li QtCriticalMsg QtFatalMsg
\row \li DLT_LOG_FATAL \li QtFatalMsg
\row \li DLT_LOG_OFF \li No message type enabled
\endtable
*/
/*!
\macro QDLT_REGISTER_APPLICATION(NAME, DESCRIPTION)
\relates <QtDlt>
Registers an application with the dlt-daemon as \a NAME and \a DESCRIPTION.
All registered DLT Logging Categories will be part of this application in the
dlt-daemon.
Only one application can be registered per process.
\note \a NAME is limited to (a size of) 4 characters.
*/
/*!
\macro QDLT_LOGGING_CATEGORY(CATEGORY, CATEGORYNAME, DLT_CTX_NAME, DLT_CTX_DESCRIPTION)
\relates <QtDlt>
Defines a new QLoggingCategory \a CATEGORY and makes it configurable under the \a CATEGORYNAME identifier.
The dlt context will be registered as \a DLT_CTX_NAME and using \a DLT_CTX_DESCRIPTION as a description.
\note \a DLT_CTX_NAME is limited to (a size of) 4 characters.
*/
/*!
\macro QDLT_REGISTER_LOGGING_CATEGORY(CATEGORY, CATEGORYNAME, DLT_CTX_NAME, DLT_CTX_DESCRIPTION)
\relates <QtDlt>
Registers an existing QLoggingCategory \a CATEGORY configurable under the \a CATEGORYNAME identifier.
The new category is mapped to the dlt context, \a DLT_CTX_NAME, with the \a DLT_CTX_DESCRIPTION.
\note \a DLT_CTX_NAME is limited to (a size of) 4 characters.
*/
/*!
\macro QDLT_FALLBACK_CATEGORY(CATEGORY)
\relates <QtDlt>
Registers an existing QLoggingCategory \a CATEGORY as the dlt fallback category. \a CATEGORY must be
already mapped to a dlt context by using QDLT_LOGGING_CATEGORY or QDLT_REGISTER_LOGGING_CATEGORY. The fallback
category is used for all log messages, which are not mapped to dlt contexts or don't use a QLoggingCategory.
*/
/*!
\macro QDLT_REGISTER_CONTEXT_ON_FIRST_USE(ENABLED)
\relates <QtDlt>
When set to \a ENABLED the registration with the dlt-daemon is done on the first use of the category.
Otherwise the registration is done directly when QDLT_LOGGING_CATEGORY or QDLT_REGISTER_LOGGING_CATEGORY
is called.
*/
/*!
\group qtgeniviextras-examples
\ingroup all-examples
\title Qt GENIVI Extras Examples
\brief Examples for the Qt GENIVI Extras module
These are the Qt GENIVI Extras examples.
*/
|