aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-17 10:25:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-17 10:25:46 +0000
commit5d300fffb9d7e236946ed9c39d411e857c3860c4 (patch)
tree9f6daf7f6da6cadf3df54aaadf22da665061752f
parent376ab2fb55f6ce153acde8f92d76656f02b85279 (diff)
downloadpaludis-5d300fffb9d7e236946ed9c39d411e857c3860c4.tar.gz
paludis-5d300fffb9d7e236946ed9c39d411e857c3860c4.tar.xz
Don't display repeated contexts
-rw-r--r--paludis/util/log.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index cbb445d..a27e12b 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.cc
@@ -108,7 +108,15 @@ Log::message(const LogLevel l, const LogContext c, const std::string & s)
} while (false);
if (lc_context == c)
- *_imp->stream << Context::backtrace("\n ... ") << s << std::endl;
+ {
+ static std::string previous_context;
+ std::string context(Context::backtrace("\n ... "));
+ if (previous_context == context)
+ *_imp->stream << "(same context) " << s << std::endl;
+ else
+ *_imp->stream << Context::backtrace("\n ... ") << s << std::endl;
+ previous_context = context;
+ }
else
*_imp->stream << s << std::endl;
}