summaryrefslogtreecommitdiffstats
path: root/common/log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/log.cpp')
-rw-r--r--common/log.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/log.cpp b/common/log.cpp
index 489e1bd..45bbec1 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -6,7 +6,7 @@
6#include <iostream> 6#include <iostream>
7#include <unistd.h> 7#include <unistd.h>
8 8
9using namespace Akonadi2::Log; 9using namespace Sink::Log;
10 10
11class DebugStream: public QIODevice 11class DebugStream: public QIODevice
12{ 12{
@@ -96,7 +96,7 @@ static QString colorCommand(QList<int> colorCodes)
96 return string; 96 return string;
97} 97}
98 98
99QByteArray Akonadi2::Log::debugLevelName(DebugLevel debugLevel) 99QByteArray Sink::Log::debugLevelName(DebugLevel debugLevel)
100{ 100{
101 switch (debugLevel) { 101 switch (debugLevel) {
102 case DebugLevel::Trace: 102 case DebugLevel::Trace:
@@ -114,7 +114,7 @@ QByteArray Akonadi2::Log::debugLevelName(DebugLevel debugLevel)
114 return QByteArray(); 114 return QByteArray();
115} 115}
116 116
117DebugLevel Akonadi2::Log::debugLevelFromName(const QByteArray &name) 117DebugLevel Sink::Log::debugLevelFromName(const QByteArray &name)
118{ 118{
119 const QByteArray lowercaseName = name.toLower(); 119 const QByteArray lowercaseName = name.toLower();
120 if (lowercaseName == "trace") 120 if (lowercaseName == "trace")
@@ -128,19 +128,19 @@ DebugLevel Akonadi2::Log::debugLevelFromName(const QByteArray &name)
128 return DebugLevel::Log; 128 return DebugLevel::Log;
129} 129}
130 130
131void Akonadi2::Log::setDebugOutputLevel(DebugLevel debugLevel) 131void Sink::Log::setDebugOutputLevel(DebugLevel debugLevel)
132{ 132{
133 qputenv("AKONADI2DEBUGLEVEL", debugLevelName(debugLevel)); 133 qputenv("SINKDEBUGLEVEL", debugLevelName(debugLevel));
134} 134}
135 135
136Akonadi2::Log::DebugLevel Akonadi2::Log::debugOutputLevel() 136Sink::Log::DebugLevel Sink::Log::debugOutputLevel()
137{ 137{
138 return debugLevelFromName(qgetenv("AKONADI2DEBUGLEVEL")); 138 return debugLevelFromName(qgetenv("SINKDEBUGLEVEL"));
139} 139}
140 140
141QDebug Akonadi2::Log::debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea) 141QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea)
142{ 142{
143 DebugLevel debugOutputLevel = debugLevelFromName(qgetenv("AKONADI2DEBUGLEVEL")); 143 DebugLevel debugOutputLevel = debugLevelFromName(qgetenv("SINKDEBUGLEVEL"));
144 if (debugLevel < debugOutputLevel) { 144 if (debugLevel < debugOutputLevel) {
145 static NullStream stream; 145 static NullStream stream;
146 return QDebug(&stream); 146 return QDebug(&stream);