diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-12 10:03:17 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-12 10:03:17 +0200 |
commit | e61c2cad0451cddf1f84a32ed818b4c3bc7b6b0f (patch) | |
tree | 82a4f71f353398e8793d771b5fc7b57173e43404 /common/log.cpp | |
parent | 4fd06c19bf8ca057f4a60f762568158fb0caa8ec (diff) | |
download | sink-e61c2cad0451cddf1f84a32ed818b4c3bc7b6b0f.tar.gz sink-e61c2cad0451cddf1f84a32ed818b4c3bc7b6b0f.zip |
Only use the filename as area, not the full path.
Diffstat (limited to 'common/log.cpp')
-rw-r--r-- | common/log.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/log.cpp b/common/log.cpp index 1fbc482..e9e16c6 100644 --- a/common/log.cpp +++ b/common/log.cpp | |||
@@ -305,6 +305,12 @@ static bool caseInsensitiveContains(const QByteArray &pattern, const QByteArrayL | |||
305 | return false; | 305 | return false; |
306 | } | 306 | } |
307 | 307 | ||
308 | static QByteArray getFileName(const char *file) | ||
309 | { | ||
310 | auto filename = QByteArray(file).split('/').last(); | ||
311 | return filename.split('.').first(); | ||
312 | } | ||
313 | |||
308 | QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char *file, const char *function, const char *debugArea, const char *debugComponent) | 314 | QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char *file, const char *function, const char *debugArea, const char *debugComponent) |
309 | { | 315 | { |
310 | static NullStream nullstream; | 316 | static NullStream nullstream; |
@@ -315,7 +321,7 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char *file, | |||
315 | if (sPrimaryComponent.isEmpty()) { | 321 | if (sPrimaryComponent.isEmpty()) { |
316 | sPrimaryComponent = getProgramName(); | 322 | sPrimaryComponent = getProgramName(); |
317 | } | 323 | } |
318 | QString fullDebugArea = sPrimaryComponent + "." + (debugComponent ? (QString::fromLatin1(debugComponent) + ".") : "") + (debugArea ? QString::fromLatin1(debugArea) : ""); | 324 | QString fullDebugArea = sPrimaryComponent + "." + (debugComponent ? (QString::fromLatin1(debugComponent) + ".") : "") + (debugArea ? QString::fromLatin1(debugArea) : getFileName(file)); |
319 | 325 | ||
320 | collectDebugArea(fullDebugArea); | 326 | collectDebugArea(fullDebugArea); |
321 | 327 | ||