aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-04-16 14:01:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-04-16 14:01:13 +0000
commita23e77e48cb880db18a83bb407cefaf2f3c5d885 (patch)
tree7e85f6d1786906c69f25fa070742e83fd3e142a4 /paludis/environments
parente20da32820ee62e72e2650dae31660657452b270 (diff)
downloadpaludis-a23e77e48cb880db18a83bb407cefaf2f3c5d885.tar.gz
paludis-a23e77e48cb880db18a83bb407cefaf2f3c5d885.tar.xz
Give log messages an id
Diffstat (limited to 'paludis/environments')
-rw-r--r--paludis/environments/no_config/no_config_environment.cc14
-rw-r--r--paludis/environments/paludis/bashable_conf.cc6
-rw-r--r--paludis/environments/paludis/keywords_conf.cc5
-rw-r--r--paludis/environments/paludis/licenses_conf.cc5
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc2
-rw-r--r--paludis/environments/paludis/paludis_config.cc72
-rw-r--r--paludis/environments/paludis/paludis_environment.cc22
-rw-r--r--paludis/environments/paludis/use_conf.cc10
-rw-r--r--paludis/environments/paludis/world.cc15
-rw-r--r--paludis/environments/portage/portage_environment.cc39
10 files changed, 98 insertions, 92 deletions
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index c75ecf3b5..aa11d7c3e 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -92,7 +92,8 @@ namespace
if ((location / "profiles").is_directory())
{
- Log::get_instance()->message(ll_debug, lc_context, "Found profiles/, looks like Ebuild format");
+ Log::get_instance()->message("no_config_environment.ebuild_detected", ll_debug, lc_context)
+ << "Found profiles/, looks like Ebuild format";
return false;
}
@@ -110,8 +111,8 @@ namespace
if ((*e / "CONTENTS").exists())
{
- Log::get_instance()->message(ll_debug, lc_context, "Found '" + stringify(*e) +
- "/CONTENTS', looks like VDB format");
+ Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context)
+ << "Found '" << stringify(*e) << "/CONTENTS', looks like VDB format";
return true;
}
@@ -149,8 +150,9 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (FSEntry("/var/empty") != params.master_repository_dir)
{
if (params.repository_dir.realpath() == params.master_repository_dir.realpath())
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring master_repository_dir '" +
- stringify(params.master_repository_dir) + "' because it is the same as repository_dir");
+ Log::get_instance()->message("no_config_environment.master_repository.ignoring", ll_warning, lc_context)
+ << "Ignoring master_repository_dir '" << params.master_repository_dir
+ << "' because it is the same as repository_dir";
else
{
@@ -203,7 +205,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
}
else
{
- Log::get_instance()->message(ll_debug, lc_context, "VDB, using vdb_db");
+ Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context) << "VDB, using vdb_db";
tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
if (params.extra_params)
diff --git a/paludis/environments/paludis/bashable_conf.cc b/paludis/environments/paludis/bashable_conf.cc
index e96148a83..ea8018172 100644
--- a/paludis/environments/paludis/bashable_conf.cc
+++ b/paludis/environments/paludis/bashable_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -48,8 +48,8 @@ paludis::paludis_environment::make_bashable_conf(const FSEntry & f)
if (exit_status != 0)
{
- Log::get_instance()->message(ll_warning, lc_context, "Script '" + stringify(f)
- + "' returned non-zero exit status '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("paludis_environment.bash_conf.failure", ll_warning, lc_context)
+ << "Script '" << f <<"' returned non-zero exit status '" << exit_status << "'";
result.reset();
}
}
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 8031d3343..d785ac20b 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -99,7 +99,8 @@ KeywordsConf::add(const FSEntry & filename)
if ("*" == tokens.at(0))
{
- Log::get_instance()->message(ll_warning, lc_context) << "Use of token '*' is deprecated, use '*/*' instead";
+ Log::get_instance()->message("paludis_environment.keywords_conf.deprecated", ll_warning, lc_context)
+ << "Use of token '*' is deprecated, use '*/*' instead";
tokens.at(0) = "*/*";
}
@@ -186,7 +187,7 @@ KeywordsConf::query(tr1::shared_ptr<const KeywordNameSet> k, const PackageID & e
i->second.first = _imp->env->set(i->first);
if (! i->second.first)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Set name '"
+ Log::get_instance()->message("paludis_environment.keywords_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
i->second.first.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index f6c3601e3..2bdbbff94 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -98,7 +98,8 @@ LicensesConf::add(const FSEntry & filename)
if ("*" == tokens.at(0))
{
- Log::get_instance()->message(ll_warning, lc_context) << "Use of token '*' is deprecated, use '*/*' instead";
+ Log::get_instance()->message("paludis_environment.licenses_conf.deprecated", ll_warning, lc_context)
+ << "Use of token '*' is deprecated, use '*/*' instead";
tokens.at(0) = "*/*";
}
@@ -178,7 +179,7 @@ LicensesConf::query(const std::string & t, const PackageID & e) const
i->second.first = _imp->env->set(i->first);
if (! i->second.first)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Set name '"
+ Log::get_instance()->message("paludis_environment.licenses_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
i->second.first.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index 6fa7f48e8..ea1505ac3 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -111,7 +111,7 @@ PackageMaskConf::query(const PackageID & e) const
it->second = _imp->env->set(it->first);
if (! it->second)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Set name '"
+ Log::get_instance()->message("paludis_environment.package_mask.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< it->first << "' does not exist";
it->second.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 810bdd8da..5a03fb208 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -166,26 +166,20 @@ namespace paludis
if (exit_status != 0)
{
- Log::get_instance()->message(ll_warning, lc_context, "Script '" + stringify(FSEntry(config_dir) / "environment.bash")
- + "' returned non-zero exit status '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("paludis_environment.environment_bash.failure", ll_warning, lc_context)
+ << "Script '" << (FSEntry(config_dir) / "environment.bash") <<
+ "' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
}
else
- Log::get_instance()->message(ll_debug, lc_context, "No environment.conf or environment.bash in '"
- + config_dir + "'");
+ Log::get_instance()->message("paludis_environment.no_environment_conf", ll_debug, lc_context)
+ << "No environment.conf or environment.bash in '" << config_dir << "'";
if (kv)
{
if (! kv->get("reduced_username").empty())
- {
reduced_username = kv->get("reduced_username");
- Log::get_instance()->message(ll_debug, lc_context,
- "loaded key 'reduced_username' = '" + reduced_username + "'");
- }
- else
- Log::get_instance()->message(ll_debug, lc_context,
- "Key 'reduced_username' is unset, using '" + reduced_username + "'");
accept_breaks_portage = kv->get("portage_compatible").empty();
distribution = kv->get("distribution");
@@ -195,8 +189,9 @@ namespace paludis
}
if (! world_file)
- Log::get_instance()->message(ll_warning, lc_context) << "No world file specified. You should "
- "specify 'world = /path/to/world/file' in " << (FSEntry(config_dir) / "environment.conf")
+ Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
+ << "No world file specified. You should specify 'world = /path/to/world/file' in "
+ << (FSEntry(config_dir) / "environment.conf")
<< ". Any attempted updates to world will not be saved.";
world.reset(new World(env, world_file));
@@ -243,8 +238,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
throw PaludisConfigNoDirectoryError("Can't find configuration directory (tried '"
+ stringify(old_config_dir) + "', '" + stringify(local_config_dir) + "')");
- Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig initial directory is '"
- + stringify(local_config_dir) + "'");
+ Log::get_instance()->message("paludis_environment.paludis_config.initial_dir", ll_debug, lc_no_context)
+ << "PaludisConfig initial directory is '" << local_config_dir << "'";
// Prefer specpath.conf over specpath. Warn if specpath is used.
if ((local_config_dir / "specpath.conf").exists() || (local_config_dir / "specpath").exists())
@@ -255,7 +250,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
else
{
specpath = new KeyValueConfigFile(local_config_dir / "specpath", KeyValueConfigFileOptions());
- Log::get_instance()->message(ll_warning, lc_no_context, "Using specpath is deprecated, use specpath.conf instead");
+ Log::get_instance()->message("paludis_environment.paludis_config.specpath.deprecated", ll_warning, lc_no_context)
+ << "Using specpath is deprecated, use specpath.conf instead";
}
root_prefix = specpath->get("root");
local_config_suffix = specpath->get("config-suffix");
@@ -277,8 +273,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
.with_uid_gid(reduced_uid(), reduced_gid()));
if (0 != run_command(cmd))
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot access configuration directory '"
- + stringify(local_config_dir) + "' using userpriv, so userpriv will be disabled");
+ Log::get_instance()->message("paludis_environment.userpriv.disabled", ll_warning, lc_context)
+ << "Cannot access configuration directory '" << local_config_dir
+ << "' using userpriv, so userpriv will be disabled. Generally Paludis "
+ "configuration directories and files should be world readable.";
_imp->reduced_uid.reset(new uid_t(getuid()));
_imp->reduced_gid.reset(new gid_t(getgid()));
}
@@ -289,9 +287,9 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
conf_vars->insert("ROOT", root_prefix);
conf_vars->insert("root", root_prefix);
- Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig real directory is '"
- + stringify(local_config_dir) + "', root prefix is '" + root_prefix +
- "', config suffix is '" + local_config_suffix + "'");
+ Log::get_instance()->message("paludis_environment.paludis_config.real_dir", ll_debug, lc_no_context)
+ << "PaludisConfig real directory is '" << local_config_dir << "', root prefix is '" << root_prefix
+ << "', config suffix is '" << local_config_suffix << "'";
/* repositories */
{
@@ -328,8 +326,9 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
KeyValueConfigFile defaults_file(s, KeyValueConfigFileOptions(), KeyValueConfigFile::Defaults(conf_vars));
std::copy(defaults_file.begin(), defaults_file.end(), conf_vars->inserter());
if (exit_status != 0)
- Log::get_instance()->message(ll_warning, lc_context, "Script '" + stringify(local_config_dir / "repository_defaults.bash")
- + "' returned non-zero exit status '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("paludis_environment.repository_defaults.failure", ll_warning, lc_context)
+ << "Script '" << (local_config_dir / "repository_defaults.bash")
+ << "' returned non-zero exit status '" << exit_status << "'";
}
std::list<FSEntry> dirs;
@@ -368,8 +367,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (exit_status != 0)
{
- Log::get_instance()->message(ll_warning, lc_context, "Script '" + stringify(*repo_file)
- + "' returned non-zero exit status '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("paludis_environment.repositories.failure", ll_warning, lc_context)
+ << "Script '" << *repo_file << "' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
}
@@ -401,13 +400,14 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (! kv->get("master_repository").empty())
{
- Log::get_instance()->message(ll_debug, lc_context, "Delaying '" + stringify(*repo_file) +
- "' because it uses master_repository");
+ Log::get_instance()->message("paludis_environment.repositories.delaying", ll_debug, lc_context)
+ << "Delaying '" << *repo_file << "' because it uses master_repository";
later_keys.push_back(keys);
}
else
{
- Log::get_instance()->message(ll_debug, lc_context, "Not delaying '" + stringify(*repo_file) + "'");
+ Log::get_instance()->message("paludis_environment.repositories.not_delaying", ll_debug, lc_context)
+ << "Not delaying '" << *repo_file << "'";
_imp->repos.push_back(RepositoryConfigEntry(format, importance, keys));
}
}
@@ -624,16 +624,16 @@ PaludisConfig::reduced_uid() const
struct passwd * p(getpwnam(reduced_username().c_str()));
if (! p)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Couldn't determine uid for user '" + reduced_username() + "'");
+ Log::get_instance()->message("paludis_environment.reduced_uid.unknown", ll_warning, lc_no_context)
+ << "Couldn't determine uid for user '" << reduced_username() << "'";
_imp->reduced_uid.reset(new uid_t(getuid()));
}
else
_imp->reduced_uid.reset(new uid_t(p->pw_uid));
}
- Log::get_instance()->message(ll_debug, lc_context, "Reduced uid is '"
- + stringify(*_imp->reduced_uid) + "'");
+ Log::get_instance()->message("paludis_environment.reduced_uid.value", ll_debug, lc_context)
+ << "Reduced uid is '" << *_imp->reduced_uid << "'";
}
return *_imp->reduced_uid;
@@ -653,8 +653,8 @@ PaludisConfig::reduced_gid() const
struct passwd * p(getpwnam(reduced_username().c_str()));
if (! p)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Couldn't determine gid for user '" + reduced_username() + "'");
+ Log::get_instance()->message("paludis_environment.reduced_gid.unknown", ll_warning, lc_no_context)
+ << "Couldn't determine gid for user '" << reduced_username() << "'";
_imp->reduced_gid.reset(new gid_t(getgid()));
}
else
@@ -671,8 +671,8 @@ PaludisConfig::reduced_username() const
Context context("When determining reduced username:");
_imp->need_environment_conf();
- Log::get_instance()->message(ll_debug, lc_context,
- "Reduced username is '" + _imp->reduced_username + "'");
+ Log::get_instance()->message("paludis_environment.reduced_username", ll_debug, lc_context)
+ << "Reduced username is '" << _imp->reduced_username << "'";
return _imp->reduced_username;
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 555eb89e2..6000c02f1 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -97,19 +97,19 @@ namespace paludis
{
if (r.is_directory())
{
- Log::get_instance()->message(ll_debug, lc_no_context, "Adding hook directory '"
- + stringify(r) + "'");
+ Log::get_instance()->message("paludis_environment.hooks.add_dir", ll_debug, lc_no_context)
+ << "Adding hook directory '" << r << "'";
hook_dirs.push_back(std::make_pair(r, v));
}
else
- Log::get_instance()->message(ll_debug, lc_no_context, "Skipping hook directory candidate '"
- + stringify(r) + "'");
+ Log::get_instance()->message("paludis_environment.hook.skipping", ll_debug, lc_no_context)
+ << "Skipping hook directory candidate '" << r << "'";
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Caught exception '" +
- e.message() + "' (" + e.what() + ") when checking hook "
- "directory '" + stringify(r) + "'");
+ Log::get_instance()->message("paludis_environment.hook.failure", ll_warning, lc_no_context)
+ << "Caught exception '" << e.message() << "' (" << e.what() << ") when checking hook "
+ "directory '" << r << "'";
}
}
@@ -153,9 +153,9 @@ PaludisEnvironment::PaludisEnvironment(const std::string & s) :
else
keys = "empty";
- Log::get_instance()->message(ll_debug, lc_context,
- "Creating repository with format='" + r->format + "', importance='"
- + stringify(r->importance) + "', keys " + keys);
+ Log::get_instance()->message("paludis_environment.making_repository", ll_debug, lc_context) <<
+ "Creating repository with format='" << r->format << "', importance='" << r->importance
+ << "', keys " << keys;
}
_imp->package_database->add_repository(r->importance,
@@ -176,7 +176,7 @@ PaludisEnvironment::query_use(const UseFlagName & f, const PackageID & e) const
PALUDIS_TLS bool recursive(false);
if (recursive)
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("paludis_environment.query_use.recursive", ll_warning, lc_context) <<
"use flag state is defined recursively, forcing it to disabled instead";
return false;
}
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 61bd2e64b..0948a6750 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -101,7 +101,8 @@ UseConf::add(const FSEntry & filename)
if ("*" == tokens.at(0))
{
- Log::get_instance()->message(ll_warning, lc_context) << "Use of token '*' is deprecated, use '*/*' instead";
+ Log::get_instance()->message("paludis_environment.use_conf.deprecated", ll_warning, lc_context)
+ << "Use of token '*' is deprecated, use '*/*' instead";
tokens.at(0) = "*/*";
}
@@ -136,7 +137,8 @@ UseConf::add(const FSEntry & filename)
if (d->additional_requirements_ptr())
{
- Log::get_instance()->message(ll_warning, lc_context) << "Dependency specification '" << stringify(*d)
+ Log::get_instance()->message("paludis_environment.use_conf.bad_spec", ll_warning, lc_context)
+ << "Dependency specification '" << stringify(*d)
<< "' includes use requirements, which cannot be used in use.conf";
continue;
}
@@ -255,7 +257,7 @@ UseConf::query(const UseFlagName & f, const PackageID & e) const
r->second.first = _imp->env->set(r->first);
if (! r->second.first)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Set name '"
+ Log::get_instance()->message("paludis_environment.use_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< r->first << "' does not exist";
r->second.first.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
@@ -348,7 +350,7 @@ UseConf::known_use_expand_names(const UseFlagName & prefix, const PackageID & e)
r->second.first = _imp->env->set(r->first);
if (! r->second.first)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Set name '"
+ Log::get_instance()->message("paludis_environment.use_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< r->first << "' does not exist";
r->second.first.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 8388168f6..4d71c6897 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -89,7 +89,8 @@ World::_add_string_to_world(const std::string & n) const
if (! _imp->maybe_world_file)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Not adding '" << n << "' to world because "
+ Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
+ << "Not adding '" << n << "' to world because "
"no world file has been configured. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
"the FAQ Upgrades section.";
return;
@@ -104,8 +105,8 @@ World::_add_string_to_world(const std::string & n) const
std::ofstream f(stringify(*_imp->maybe_world_file).c_str());
if (! f)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
- + stringify(*_imp->maybe_world_file) + "'");
+ Log::get_instance()->message("paludis_environment.world.cannot_create", ll_warning, lc_no_context)
+ << "Cannot create world file '" << *_imp->maybe_world_file << "'";
return;
}
}
@@ -127,8 +128,8 @@ World::_remove_string_from_world(const std::string & n) const
if (! _imp->maybe_world_file)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Not removing '" << n << "' from world because "
- "no world file has been configured";
+ Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
+ << "Not removing '" << n << "' from world because no world file has been configured";
return;
}
@@ -170,8 +171,8 @@ World::world_set() const
return world.contents();
}
else
- Log::get_instance()->message(ll_warning, lc_no_context) << "World file '" << *_imp->maybe_world_file
- << "' doesn't exist";
+ Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_no_context)
+ << "World file '" << *_imp->maybe_world_file << "' doesn't exist";
}
return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index f66219c6d..c6f2ecc71 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -117,19 +117,19 @@ namespace paludis
{
if (r.is_directory())
{
- Log::get_instance()->message(ll_debug, lc_no_context, "Adding hook directory '"
- + stringify(r) + "'");
+ Log::get_instance()->message("portage_environment.hooks.add_dir", ll_debug, lc_no_context)
+ << "Adding hook directory '" << r << "'";
hook_dirs.push_back(r);
}
else
- Log::get_instance()->message(ll_debug, lc_no_context, "Skipping hook directory candidate '"
- + stringify(r) + "'");
+ Log::get_instance()->message("portage_environment.hooks.skipping", ll_debug, lc_no_context)
+ << "Skipping hook directory candidate '" << r << "'";
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Caught exception '" +
- e.message() + "' (" + e.what() + ") when checking hook "
- "directory '" + stringify(r) + "'");
+ Log::get_instance()->message("portage_environment.hooks.failure", ll_warning, lc_no_context)
+ << "Caught exception '" << e.message() << "' (" << e.what() << ") when checking hook "
+ "directory '" << r << "'";
}
}
@@ -178,11 +178,10 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
Context context("When creating PortageEnvironment using config root '" + s + "':");
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Use of Portage configuration files will lead to sub-optimal performance and loss of "
- "functionality. Full support for Portage configuration formats is not "
- "guaranteed; issues should be reported via trac. You are strongly encouraged "
- "to migrate to a Paludis configuration.");
+ Log::get_instance()->message("portage_environment.dodgy", ll_warning, lc_no_context) <<
+ "Use of Portage configuration files will lead to sub-optimal performance and loss of "
+ "functionality. Full support for Portage configuration formats is not "
+ "guaranteed; issues should be reported via trac.";
_imp->vars.reset(new KeyValueConfigFile(FSEntry("/dev/null"), KeyValueConfigFileOptions()));
_load_profile((_imp->conf_dir / "make.profile").realpath());
@@ -448,7 +447,7 @@ PortageEnvironment::query_use(const UseFlagName & f, const PackageID & e) const
PALUDIS_TLS bool recursive(false);
if (recursive)
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("portage_environment.query_use.recursive", ll_warning, lc_context) <<
"use flag state is defined recursively, forcing it to disabled instead";
return false;
}
@@ -600,8 +599,9 @@ PortageEnvironment::known_use_expand_names(const UseFlagName & prefix,
result->insert(UseFlagName(i->second));
}
- Log::get_instance()->message(ll_debug, lc_no_context) << "PortageEnvironment::known_use_expand_names("
- << prefix << ", " << pde << ") -> (" << join(result->begin(), result->end(), ", ") << ")";
+ Log::get_instance()->message("portage_environment.known_use_expand_names", ll_debug, lc_no_context)
+ << "PortageEnvironment::known_use_expand_names("
+ << prefix << ", " << pde << ") -> (" << join(result->begin(), result->end(), ", ") << ")";
return result;
}
@@ -784,8 +784,8 @@ PortageEnvironment::_add_string_to_world(const std::string & s) const
std::ofstream f(stringify(_imp->world_file).c_str());
if (! f)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
- + stringify(_imp->world_file) + "'");
+ Log::get_instance()->message("portage_environment.world.write_failed", ll_warning, lc_no_context)
+ << "Cannot create world file '" << _imp->world_file << "'";
return;
}
}
@@ -845,9 +845,8 @@ PortageEnvironment::world_set() const
return world.contents();
}
else
- Log::get_instance()->message(ll_warning, lc_no_context,
- "World file '" + stringify(_imp->world_file) +
- "' doesn't exist");
+ Log::get_instance()->message("portage_environment.world_file.does_not_exist", ll_warning, lc_no_context) <<
+ "World file '" << _imp->world_file << "' doesn't exist";
return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));