Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Network
Kaidan
Commits
7654f518
Commit
7654f518
authored
Feb 17, 2018
by
Linus Jahn
Committed by
Jonah Brüchert
Feb 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XmlLogHandler: Clean up coding style
parent
5c513623
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
src/XmlLogHandler.cpp
src/XmlLogHandler.cpp
+16
-11
src/XmlLogHandler.h
src/XmlLogHandler.h
+3
-1
No files found.
src/XmlLogHandler.cpp
View file @
7654f518
...
...
@@ -29,16 +29,21 @@
*/
#include "XmlLogHandler.h"
#include <gloox/loghandler.h>
// gloox
#include <gloox/client.h>
// Qt
#include <QDebug>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
XmlLogHandler
::
XmlLogHandler
(
gloox
::
Client
*
client
)
:
client
(
client
)
{
client
->
logInstance
().
registerLogHandler
(
gloox
::
LogLevelDebug
,
gloox
::
LogAreaXmlIncoming
|
gloox
::
LogAreaXmlOutgoing
,
this
);
client
->
logInstance
().
registerLogHandler
(
gloox
::
LogLevelDebug
,
gloox
::
LogAreaXmlIncoming
|
gloox
::
LogAreaXmlOutgoing
,
this
);
}
XmlLogHandler
::~
XmlLogHandler
()
...
...
@@ -46,15 +51,15 @@ XmlLogHandler::~XmlLogHandler()
client
->
logInstance
().
removeLogHandler
(
this
);
}
void
XmlLogHandler
::
handleLog
(
gloox
::
LogLevel
level
,
gloox
::
LogArea
area
,
const
std
::
string
&
message
)
void
XmlLogHandler
::
handleLog
(
gloox
::
LogLevel
level
,
gloox
::
LogArea
area
,
const
std
::
string
&
message
)
{
if
(
area
==
gloox
::
LogAreaXmlIncoming
)
{
qDebug
()
<<
"[XML] [Incoming] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
;
qDebug
().
noquote
()
<<
makeXmlPretty
(
QString
::
fromStdString
(
message
));
}
else
if
(
area
==
gloox
::
LogAreaXmlOutgoing
)
{
qDebug
()
<<
"[XML] [Outgoing] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
;
qDebug
().
noquote
()
<<
makeXmlPretty
(
QString
::
fromStdString
(
message
));
}
if
(
area
==
gloox
::
LogAreaXmlIncoming
)
qDebug
()
<<
"[client] [incoming] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
;
else
if
(
area
==
gloox
::
LogAreaXmlOutgoing
)
qDebug
()
<<
"[client] [outgoing] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
;
qDebug
().
noquote
()
<<
makeXmlPretty
(
QString
::
fromStdString
(
message
));
}
QString
XmlLogHandler
::
makeXmlPretty
(
QString
xmlIn
)
...
...
src/XmlLogHandler.h
View file @
7654f518
...
...
@@ -43,7 +43,9 @@ class XmlLogHandler : public gloox::LogHandler
public:
XmlLogHandler
(
gloox
::
Client
*
client
);
~
XmlLogHandler
();
virtual
void
handleLog
(
gloox
::
LogLevel
level
,
gloox
::
LogArea
area
,
const
std
::
string
&
message
);
virtual
void
handleLog
(
gloox
::
LogLevel
level
,
gloox
::
LogArea
area
,
const
std
::
string
&
message
);
static
QString
makeXmlPretty
(
QString
inputXml
);
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment