aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-18 21:34:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-18 21:34:26 +0000
commit0ab32ea49c0d1509b848664ae859c6e28e2c0441 (patch)
treec63bd4b659178186ffbbac0b08dc2e3c8bef3b34
parentba56eb88b8035d113c366109b3750fd3248d4180 (diff)
downloadpaludis-0ab32ea49c0d1509b848664ae859c6e28e2c0441.tar.gz
paludis-0ab32ea49c0d1509b848664ae859c6e28e2c0441.tar.xz
Fix g++-3.4 compiles
-rw-r--r--paludis/hook.cc5
-rw-r--r--paludis/util/log.cc7
-rw-r--r--paludis/util/log.hh3
3 files changed, 9 insertions, 6 deletions
diff --git a/paludis/hook.cc b/paludis/hook.cc
index 0591952..c3c32ad 100644
--- a/paludis/hook.cc
+++ b/paludis/hook.cc
@@ -74,8 +74,9 @@ Hook::operator() (const std::string & k, const std::string & v) const
std::string
Hook::get(const std::string & k) const
{
- if (_imp->extra_env.end() != _imp->extra_env.find(k))
- return _imp->extra_env.at(k);
+ std::map<std::string, std::string>::const_iterator i(_imp->extra_env.find(k));
+ if (i != _imp->extra_env.end())
+ return i->second;
else
return std::string("");
}
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index 5cfda2d..7d42776 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.cc
@@ -140,7 +140,7 @@ Log::message(const LogLevel l, const LogContext c, const std::string & s)
LogMessageHandler
Log::message(const LogLevel l, const LogContext c)
{
- return LogMessageHandler(l, c);
+ return LogMessageHandler(this, l, c);
}
void
@@ -183,7 +183,8 @@ Log::set_program_name(const std::string & s)
_imp->program_name = s;
}
-LogMessageHandler::LogMessageHandler(const LogLevel l, const LogContext c) :
+LogMessageHandler::LogMessageHandler(Log * const ll, const LogLevel l, const LogContext c) :
+ _log(ll),
_log_level(l),
_log_context(c)
{
@@ -198,6 +199,6 @@ LogMessageHandler::_append(const std::string & s)
LogMessageHandler::~LogMessageHandler()
{
if (! std::uncaught_exception() && ! _message.empty())
- Log::get_instance()->_message(_log_level, _log_context, _message);
+ _log->_message(_log_level, _log_context, _message);
}
diff --git a/paludis/util/log.hh b/paludis/util/log.hh
index 74fb517..9626dc4 100644
--- a/paludis/util/log.hh
+++ b/paludis/util/log.hh
@@ -129,12 +129,13 @@ namespace paludis
friend LogMessageHandler Log::message(const LogLevel, const LogContext);
private:
+ Log * _log;
std::string _message;
LogLevel _log_level;
LogContext _log_context;
LogMessageHandler(const LogMessageHandler &);
- LogMessageHandler(const LogLevel, const LogContext);
+ LogMessageHandler(Log * const, const LogLevel, const LogContext);
void operator= (const LogMessageHandler &);
void _append(const std::string & s);