summaryrefslogtreecommitdiff
path: root/sal/osl/all
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-04-03 17:14:43 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-04-03 18:16:38 +0200
commitf46775a206589fb9486833ae2e043731cb6be54f (patch)
tree8ef070fe4e6b1cb8a66fd02bd22b1c515ba2f9eb /sal/osl/all
parentf4e0cbaa15c2861e87149a62c9c80a9e9b4094b3 (diff)
SAL_DEBUG(), instead of those temporary debug printf's
Diffstat (limited to 'sal/osl/all')
-rw-r--r--sal/osl/all/log.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index 6e7009a82b3d..43d704541a0b 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -77,10 +77,14 @@ char const * toString(sal_detail_LogLevel level) {
return "info";
case SAL_DETAIL_LOG_LEVEL_WARN:
return "warn";
+ case SAL_DETAIL_LOG_LEVEL_DEBUG:
+ return "debug";
}
}
bool report(sal_detail_LogLevel level, char const * area) {
+ if (level == SAL_DETAIL_LOG_LEVEL_DEBUG)
+ return true;
assert(area != 0);
char const * env = std::getenv("SAL_LOG");
if (env == 0) {
@@ -152,9 +156,12 @@ void log(
char const * message)
{
std::ostringstream s;
- s << toString(level) << ':' << area << ':' << OSL_DETAIL_GETPID << ':'
- << osl::Thread::getCurrentIdentifier() << ':' << where << message
- << '\n';
+ if (level == SAL_DETAIL_LOG_LEVEL_DEBUG)
+ s << toString(level) << ':' << /*no where*/' ' << message << '\n';
+ else
+ s << toString(level) << ':' << area << ':' << OSL_DETAIL_GETPID << ':'
+ << osl::Thread::getCurrentIdentifier() << ':' << where << message
+ << '\n';
std::fputs(s.str().c_str(), stderr);
}