diff options
author | Marja Hassinen <marja.hassinen@nokia.com> | 2010-09-10 16:02:07 +0300 |
---|---|---|
committer | Marja Hassinen <marja.hassinen@nokia.com> | 2010-09-10 16:02:07 +0300 |
commit | d08d2d999adc56de72e66d8e9d1e582d560d4932 (patch) | |
tree | 260a1dbb62b57aa430981f0e4f603d77bc1cc03c /common | |
parent | 3714b71e80ff510478768fcd7b95c6426a6f99b3 (diff) |
Removing the "show features" and "hide features" features from the logger.
They were using static QStringLists which caused problems (NB#187390) and
were not that much used anyway.
Diffstat (limited to 'common')
-rw-r--r-- | common/logging.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/common/logging.cpp b/common/logging.cpp index bad377b4..fce51de6 100644 --- a/common/logging.cpp +++ b/common/logging.cpp @@ -151,26 +151,6 @@ contextDebug() << contextFeature("threads") << "Some message..." << contextFeature("another"); \endcode - There are two enviornment variables that control the output of messages vs. features: \b - CONTEXT_LOG_SHOW_FEATURES and \b CONTEXT_LOG_HIDE_FEATURES. Both take a comma-separated - list of features. - - If you specify CONTEXT_LOG_SHOW_FEATURES only messages with given features will be printed to - the screen. If you specify \b CONTEXT_LOG_HIDE_FEATURES, messages with the specified features - will be hidden (not displayed). For example: - - \code - CONTEXT_LOG_SHOW_FEATURES="threads,util" ./some-binary - \endcode - - ...will make \b only the messages belonging to "threads" or "util" features displayed. - - \code - CONTEXT_LOG_HIDE_FEATURES="threads,util" ./some-binary - \endcode - - ...will hide all logging messages belonging to "threads" and "util" feature groups. - \section vanilla Vanilla If the default logging output is too much for you, it's possible to set a CONTEXT_LOG_VANILLA @@ -230,8 +210,6 @@ char* ContextRealLogger::showModule = NULL; char* ContextRealLogger::hideModule = NULL; bool ContextRealLogger::initialized = false; bool ContextRealLogger::vanilla = false; -QStringList ContextRealLogger::showFeatures = QStringList(); -QStringList ContextRealLogger::hideFeatures = QStringList(); /// Initialize the class by checking the enviornment variables and setting /// the message output params. The log level is set from \c CONTEXT_LOG_VERBOSITY @@ -246,20 +224,6 @@ void ContextRealLogger::initialize() if (getenv("CONTEXT_LOG_USE_COLOR") != NULL) useColor = true; - // Check feature enablers (showFeatures) - const char *showFeaturesStr = getenv("CONTEXT_LOG_SHOW_FEATURES"); - if (showFeaturesStr) { - Q_FOREACH (QString f, QString(showFeaturesStr).split(',')) - showFeatures << f.trimmed(); - } - - // Check feature hide (hideFeatures) - const char *hideFeaturesStr = getenv("CONTEXT_LOG_HIDE_FEATURES"); - if (hideFeaturesStr) { - Q_FOREACH (QString f, QString(hideFeaturesStr).split(',')) - hideFeatures << f.trimmed(); - } - // Show/hide given module showModule = getenv("CONTEXT_LOG_SHOW_MODULE"); hideModule = getenv("CONTEXT_LOG_HIDE_MODULE"); @@ -362,20 +326,6 @@ bool ContextRealLogger::shouldPrint() if (hideModule && strcmp(hideModule, moduleName) == 0) return false; - // Now try to eliminate by feature name - Q_FOREACH(QString feature, features) { - if (hideFeatures.contains(feature)) - return false; - } - - if (showFeatures.length() > 0) { - Q_FOREACH(QString feature, showFeatures) { - if (features.contains(feature)) - return true; - } - return false; - } - return true; } |