diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2013-01-31 18:23:59 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-02-06 10:36:05 +0100 |
commit | aea6cbfa9d96f3f76bbc3b81362c54c9322b3fcb (patch) | |
tree | c140b905b53b01e509ad923a12e5b31f043f3361 /src/app/qbs/parser/commandlineoption.cpp | |
parent | e5545733e8f63f62d499e73a27a72fc898a58e4e (diff) |
Remove global log sink.
Applications may not want to use the same log sink for all builds.
The logging facility is also decoupled from the command-line client in other
ways:
- The LogWriter modifiers for output channel and text color are gone,
since this type of decision should not be made by low-level code.
Instead, the "highlight" string can be forwarded to the log sink.
- The console logger now lives in app/shared, as it must never be used
by library code.
Change-Id: I8863a554c9b74577320ef23f6f934a74e0f0cbb0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app/qbs/parser/commandlineoption.cpp')
-rw-r--r-- | src/app/qbs/parser/commandlineoption.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/app/qbs/parser/commandlineoption.cpp b/src/app/qbs/parser/commandlineoption.cpp index 4aab3d054..a443afede 100644 --- a/src/app/qbs/parser/commandlineoption.cpp +++ b/src/app/qbs/parser/commandlineoption.cpp @@ -195,7 +195,7 @@ QString ShowProgressOption::description(CommandType command) const Q_UNUSED(command); return Tr::tr("%1\n" "\tShow a progress bar. Implies '%2=%3'.\n").arg(longRepresentation(), - loglevelLongRepresentation(), Logger::logLevelName(LoggerMinLevel)); + loglevelLongRepresentation(), logLevelName(LoggerMinLevel)); } QString ShowProgressOption::longRepresentation() const @@ -259,11 +259,11 @@ static QStringList allLogLevelStrings() { QStringList result; for (int i = static_cast<int>(LoggerMinLevel); i <= static_cast<int>(LoggerMaxLevel); ++i) - result << Logger::logLevelName(static_cast<LoggerLevel>(i)); + result << logLevelName(static_cast<LoggerLevel>(i)); return result; } -LogLevelOption::LogLevelOption() : m_logLevel(Logger::defaultLevel()) +LogLevelOption::LogLevelOption() : m_logLevel(defaultLogLevel()) { } @@ -273,8 +273,7 @@ QString LogLevelOption::description(CommandType command) const return Tr::tr("%1 <level>\n" "\tUse the specified log level. Possible values are '%2'.\n" "\tThe default is '%3'.\n").arg(longRepresentation(), - allLogLevelStrings().join(QLatin1String("', '")), - Logger::logLevelName(Logger::defaultLevel())); + allLogLevelStrings().join(QLatin1String("', '")), logLevelName(defaultLogLevel())); } QString LogLevelOption::longRepresentation() const @@ -288,7 +287,7 @@ void LogLevelOption::doParse(const QString &representation, QStringList &input) const QList<LoggerLevel> levels = QList<LoggerLevel>() << LoggerError << LoggerWarning << LoggerInfo << LoggerDebug << LoggerTrace; foreach (LoggerLevel l, levels) { - if (Logger::logLevelName(l) == levelString) { + if (logLevelName(l) == levelString) { m_logLevel = l; return; } |