Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
d0badaa4
Commit
d0badaa4
authored
May 10, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app/logger/Logger): log thread
parent
4e56e23c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Logger.cpp
linphone-desktop/src/app/logger/Logger.cpp
+8
-7
No files found.
linphone-desktop/src/app/logger/Logger.cpp
View file @
d0badaa4
...
...
@@ -23,6 +23,7 @@
#include <bctoolbox/logging.h>
#include <linphone/linphonecore.h>
#include <QDateTime>
#include <QThread>
#include "../../Utils.hpp"
#include "../paths/Paths.hpp"
...
...
@@ -43,7 +44,7 @@
#define PURPLE ""
#define RED ""
#define RESET ""
#endif // if
def __linux__
#endif // if
defined(__linux__) || defined(__APPLE__)
#define QT_DOMAIN "qt"
...
...
@@ -103,19 +104,19 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri
BctbxLogLevel
level
;
if
(
type
==
QtDebugMsg
)
{
format
=
GREEN
"[%s][Debug]"
PURPLE
"%s"
RESET
"%s
\n
"
;
format
=
GREEN
"[%s][
%p][
Debug]"
PURPLE
"%s"
RESET
"%s
\n
"
;
level
=
BCTBX_LOG_DEBUG
;
}
else
if
(
type
==
QtInfoMsg
)
{
format
=
BLUE
"[%s][Info]"
PURPLE
"%s"
RESET
"%s
\n
"
;
format
=
BLUE
"[%s][
%p][
Info]"
PURPLE
"%s"
RESET
"%s
\n
"
;
level
=
BCTBX_LOG_MESSAGE
;
}
else
if
(
type
==
QtWarningMsg
)
{
format
=
RED
"[%s][Warning]"
PURPLE
"%s"
RESET
"%s
\n
"
;
format
=
RED
"[%s][
%p][
Warning]"
PURPLE
"%s"
RESET
"%s
\n
"
;
level
=
BCTBX_LOG_WARNING
;
}
else
if
(
type
==
QtCriticalMsg
)
{
format
=
RED
"[%s][Critical]"
PURPLE
"%s"
RESET
"%s
\n
"
;
format
=
RED
"[%s][
%p][
Critical]"
PURPLE
"%s"
RESET
"%s
\n
"
;
level
=
BCTBX_LOG_ERROR
;
}
else
if
(
type
==
QtFatalMsg
)
{
format
=
RED
"[%s][Fatal]"
PURPLE
"%s"
RESET
"%s
\n
"
;
format
=
RED
"[%s][
%p][
Fatal]"
PURPLE
"%s"
RESET
"%s
\n
"
;
level
=
BCTBX_LOG_FATAL
;
}
else
return
;
...
...
@@ -144,7 +145,7 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri
mMutex
.
lock
();
fprintf
(
stderr
,
format
,
dateTime
.
constData
(),
context_str
,
localMsg
.
constData
());
fprintf
(
stderr
,
format
,
dateTime
.
constData
(),
QThread
::
currentThread
(),
context_str
,
localMsg
.
constData
());
bctbx_log
(
QT_DOMAIN
,
level
,
"QT: %s%s"
,
context_str
,
localMsg
.
constData
());
mMutex
.
unlock
();
...
...
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