aboutsummaryrefslogtreecommitdiff
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
parente20da32820ee62e72e2650dae31660657452b270 (diff)
downloadpaludis-a23e77e48cb880db18a83bb407cefaf2f3c5d885.tar.gz
paludis-a23e77e48cb880db18a83bb407cefaf2f3c5d885.tar.xz
Give log messages an id
-rw-r--r--doc/api/cplusplus/examples/example_dep_tree.cc6
-rw-r--r--paludis/args/dep_list_args_group.cc2
-rw-r--r--paludis/dep_list.cc58
-rw-r--r--paludis/dep_spec_flattener.cc4
-rw-r--r--paludis/environment_implementation.cc9
-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
-rw-r--r--paludis/hooker.cc131
-rw-r--r--paludis/install_task.cc12
-rw-r--r--paludis/merger.cc96
-rw-r--r--paludis/name.cc4
-rw-r--r--paludis/ndbam.cc46
-rw-r--r--paludis/ndbam_merger.cc2
-rw-r--r--paludis/ndbam_unmerger.cc4
-rw-r--r--paludis/package_database.cc4
-rw-r--r--paludis/python_hooks.cc122
-rw-r--r--paludis/query_visitor.cc5
-rw-r--r--paludis/report_task.cc9
-rw-r--r--paludis/repositories/cran/cran_package_id.cc12
-rw-r--r--paludis/repositories/cran/cran_repository.cc8
-rw-r--r--paludis/repositories/cran/description_file.cc6
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc37
-rw-r--r--paludis/repositories/e/conditional_dep_spec.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc7
-rw-r--r--paludis/repositories/e/e_key.cc6
-rw-r--r--paludis/repositories/e/e_repository.cc38
-rw-r--r--paludis/repositories/e/e_repository_news.cc35
-rw-r--r--paludis/repositories/e/e_repository_profile.cc67
-rw-r--r--paludis/repositories/e/e_repository_profile_file.cc4
-rw-r--r--paludis/repositories/e/e_repository_sets.cc17
-rw-r--r--paludis/repositories/e/ebuild.cc26
-rw-r--r--paludis/repositories/e/ebuild_entries.cc19
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc18
-rw-r--r--paludis/repositories/e/ebuild_id.cc11
-rw-r--r--paludis/repositories/e/exheres_layout.cc28
-rw-r--r--paludis/repositories/e/exndbam_repository.cc5
-rw-r--r--paludis/repositories/e/fetch_visitor.cc6
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc13
-rw-r--r--paludis/repositories/e/manifest2_reader.cc2
-rw-r--r--paludis/repositories/e/package_dep_spec.cc25
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc32
-rw-r--r--paludis/repositories/e/qa/categories.cc4
-rw-r--r--paludis/repositories/e/qa/changelog.cc4
-rw-r--r--paludis/repositories/e/qa/default_functions.cc4
-rw-r--r--paludis/repositories/e/qa/deprecated_functions.cc9
-rw-r--r--paludis/repositories/e/qa/ebuild_count.cc4
-rw-r--r--paludis/repositories/e/qa/extractors.cc5
-rw-r--r--paludis/repositories/e/qa/fetches_key.cc2
-rw-r--r--paludis/repositories/e/qa/files_dir_size.cc4
-rw-r--r--paludis/repositories/e/qa/function_keyword.cc4
-rw-r--r--paludis/repositories/e/qa/header.cc6
-rw-r--r--paludis/repositories/e/qa/homepage_key.cc2
-rw-r--r--paludis/repositories/e/qa/inherited_key.cc7
-rw-r--r--paludis/repositories/e/qa/iuse_key.cc5
-rw-r--r--paludis/repositories/e/qa/keywords_key.cc4
-rw-r--r--paludis/repositories/e/qa/kv_variables.cc4
-rw-r--r--paludis/repositories/e/qa/license_key.cc2
-rw-r--r--paludis/repositories/e/qa/manifest.cc2
-rw-r--r--paludis/repositories/e/qa/metadata_keys.cc2
-rw-r--r--paludis/repositories/e/qa/misc_files.cc4
-rw-r--r--paludis/repositories/e/qa/restrict_key.cc2
-rw-r--r--paludis/repositories/e/qa/root_variable.cc4
-rw-r--r--paludis/repositories/e/qa/short_description_key.cc4
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc5
-rw-r--r--paludis/repositories/e/qa/stray_files.cc4
-rw-r--r--paludis/repositories/e/qa/subshell_die.cc4
-rw-r--r--paludis/repositories/e/qa/variable_assigns.cc6
-rw-r--r--paludis/repositories/e/qa/visibility.cc5
-rw-r--r--paludis/repositories/e/qa/whitespace.cc6
-rw-r--r--paludis/repositories/e/registration.cc4
-rw-r--r--paludis/repositories/e/source_uri_finder.cc23
-rw-r--r--paludis/repositories/e/traditional_layout.cc32
-rw-r--r--paludis/repositories/e/vdb_merger.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc64
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc9
-rw-r--r--paludis/repositories/gems/gem_specifications.cc4
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc9
-rw-r--r--paludis/repository.cc5
-rw-r--r--paludis/repository_name_cache.cc51
-rw-r--r--paludis/selinux/security_context.cc4
-rw-r--r--paludis/set_file.cc45
-rw-r--r--paludis/show_suggest_visitor.cc19
-rw-r--r--paludis/stripper.cc9
-rw-r--r--paludis/syncer.cc6
-rw-r--r--paludis/uninstall_list.cc14
-rw-r--r--paludis/user_dep_spec.cc7
-rw-r--r--paludis/util/log.cc32
-rw-r--r--paludis/util/log.hh17
-rw-r--r--paludis/util/log_TEST.cc16
-rw-r--r--paludis/util/pipe.cc8
-rw-r--r--paludis/util/system.cc38
-rw-r--r--paludis/util/system_TEST.cc4
-rw-r--r--paludis/util/thread.cc4
-rw-r--r--paludis/version_spec.cc8
-rw-r--r--python/log.cc14
-rwxr-xr-xpython/log_TEST.py2
-rw-r--r--ruby/log.cc12
-rw-r--r--ruby/log_TEST.rb8
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc6
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc10
-rw-r--r--src/clients/contrarius/target_config.cc10
-rw-r--r--src/clients/inquisitio/do_search.cc4
-rw-r--r--src/clients/inquisitio/inquisitio.cc8
-rw-r--r--src/clients/paludis/applets.cc14
-rw-r--r--src/clients/paludis/paludis.cc31
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc31
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.cc45
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc36
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc17
-rw-r--r--src/output/console_install_task.cc6
120 files changed, 1018 insertions, 920 deletions
diff --git a/doc/api/cplusplus/examples/example_dep_tree.cc b/doc/api/cplusplus/examples/example_dep_tree.cc
index 26717c0..a84e3e5 100644
--- a/doc/api/cplusplus/examples/example_dep_tree.cc
+++ b/doc/api/cplusplus/examples/example_dep_tree.cc
@@ -98,7 +98,8 @@ namespace
* that doesn't exist. */
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << spec << "'";
+ Log::get_instance()->message("example_set.unknown_set", ll_warning, lc_context)
+ << "Unknown set '" << spec << "'";
return;
}
@@ -108,7 +109,8 @@ namespace
* other sets inbetween (a includes b includes a). */
if (! _recursing_sets.insert(spec.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << spec << "'";
+ Log::get_instance()->message("example_set.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << spec << "'";
return;
}
diff --git a/paludis/args/dep_list_args_group.cc b/paludis/args/dep_list_args_group.cc
index 6241e6d..a92159c 100644
--- a/paludis/args/dep_list_args_group.cc
+++ b/paludis/args/dep_list_args_group.cc
@@ -256,7 +256,7 @@ DepListArgsGroup::populate_dep_list_options(const Environment * env, DepListOpti
options.override_masks->push_back(tr1::bind(&override_license, _2));
else if (*a == "profile")
{
- Log::get_instance()->message(ll_warning, lc_no_context) <<
+ Log::get_instance()->message("paludis.args.deprecated", ll_warning, lc_no_context) <<
"--dl-override-masks profile is deprecated, use --dl-override-masks repository";
options.override_masks->push_back(tr1::bind(&override_repository_masks, _2));
}
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index ed7f1cc..7b62bbe 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -371,7 +371,7 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
if (v.result)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Skipping dep '"
+ Log::get_instance()->message("dep_list.skipping_suggested", ll_debug, lc_context) << "Skipping dep '"
<< a << "' because suggested label is active";
return;
}
@@ -423,8 +423,8 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
if (d->_imp->opts->circular == dl_circular_discard)
{
- Log::get_instance()->message(ll_qa, lc_context, "Dropping circular dependency on '"
- + stringify(*existing_merge_list_entry->package_id) + "'");
+ Log::get_instance()->message("dep_list.dropping_circular", ll_qa, lc_context)
+ << "Dropping circular dependency on '" << *existing_merge_list_entry->package_id << "'";
return;
}
else if (d->_imp->opts->circular == dl_circular_discard_silently)
@@ -544,9 +544,8 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
}
else
{
- Log::get_instance()->message(ll_warning, lc_context, "No visible packages matching '"
- + stringify(a) + "', falling back to installed package '"
- + stringify(**already_installed->last()) + "'");
+ Log::get_instance()->message("dep_list.no_visible", ll_warning, lc_context) << "No visible packages matching '"
+ << a << "', falling back to installed package '" << **already_installed->last() << "'";
d->add_already_installed_package(*already_installed->last(), a.tag(), a, conditions, destinations);
return;
}
@@ -565,16 +564,16 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
{
if (d->prefer_installed_over_uninstalled(**already_installed_in_same_slot->last(), *best_visible_candidate))
{
- Log::get_instance()->message(ll_debug, lc_context, "Taking installed package '"
- + stringify(**already_installed_in_same_slot->last()) + "' over '" +
- stringify(*best_visible_candidate) + "'");
+ Log::get_instance()->message("dep_list.installed_over_best_visible", ll_debug, lc_context)
+ << "Taking installed package '" << **already_installed_in_same_slot->last() << "' over '"
+ << *best_visible_candidate << "'";
d->add_already_installed_package(*already_installed_in_same_slot->last(), a.tag(), a, conditions, destinations);
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context, "Not taking installed package '"
- + stringify(**already_installed_in_same_slot->last()) + "' over '" +
- stringify(*best_visible_candidate) + "'");
+ Log::get_instance()->message("dep_list.best_visible_over_installed", ll_debug, lc_context)
+ << "Not taking installed package '" << **already_installed_in_same_slot->last() << "' over '"
+ << *best_visible_candidate << "'";
}
else if ((! already_installed->empty()) && (dl_new_slots_as_needed == d->_imp->opts->new_slots))
{
@@ -582,19 +581,19 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
* allow us to take this. */
if (d->prefer_installed_over_uninstalled(**already_installed->last(), *best_visible_candidate))
{
- Log::get_instance()->message(ll_debug, lc_context, "Taking installed package '"
- + stringify(**already_installed->last()) + "' over '" + stringify(*best_visible_candidate)
- + "' (in different slot)");
+ Log::get_instance()->message("dep_list.installed_over_slot", ll_debug, lc_context) <<
+ "Taking installed package '" << **already_installed->last() << "' over '" << *best_visible_candidate <<
+ "' (in different slot)";
d->add_already_installed_package(*already_installed->last(), a.tag(), a, conditions, destinations);
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context, "Not taking installed package '"
- + stringify(**already_installed->last()) + "' over '" +
- stringify(*best_visible_candidate) + "' (in different slot)");
+ Log::get_instance()->message("dep_list.slot_over_installed", ll_debug, lc_context) <<
+ "Not taking installed package '" << **already_installed->last() << "' over '" <<
+ *best_visible_candidate << "' (in different slot)";
}
else
- Log::get_instance()->message(ll_debug, lc_context) << "No installed packages in SLOT '"
+ Log::get_instance()->message("dep_list.no_installed", ll_debug, lc_context) << "No installed packages in SLOT '"
<< best_visible_candidate->slot() << "', taking uninstalled package '"
<< *best_visible_candidate << "'";
@@ -626,7 +625,7 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
throw DowngradeNotAllowedError(stringify(*best_visible_candidate),
stringify(**are_we_downgrading->last()));
- Log::get_instance()->message(ll_warning, lc_context) << "Downgrade to '"
+ Log::get_instance()->message("dep_list.downgrade", ll_warning, lc_context) << "Downgrade to '"
<< *best_visible_candidate << "' from '" << **are_we_downgrading->last() << "' forced";
}
break;
@@ -650,7 +649,7 @@ DepList::AddVisitor::visit_leaf(const NamedSetDepSpec & a)
if (! recursing_sets.insert(a.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << a.name() << "'";
+ Log::get_instance()->message("dep_list.recursive_set", ll_warning, lc_context) << "Recursively defined set '" << a.name() << "'";
throw RecursivelyDefinedSetError(stringify(a.name()));
}
@@ -784,8 +783,8 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
}
}
- Log::get_instance()->message(ll_debug, lc_context, "No resolvable item in || ( ) block. Using "
- "first item for error message");
+ Log::get_instance()->message("dep_list.using_first_any_item", ll_debug, lc_context)
+ << "No resolvable item in || ( ) block. Using first item for error message";
{
Context block_context("Inside || ( ) block with other options:");
for (DependencySpecTree::ConstSequenceIterator c(cur) ; c != end ; ++c)
@@ -897,8 +896,8 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
throw BlockError(stringify(*a.blocked_spec()));
case dl_blocks_discard:
- Log::get_instance()->message(ll_warning, lc_context, "Discarding block '!"
- + stringify(*a.blocked_spec()) + "'");
+ Log::get_instance()->message("dep_list.discarding_block", ll_warning, lc_context) << "Discarding block '!"
+ << *a.blocked_spec() << "'";
break;
case dl_blocks_discard_completely:
@@ -1267,8 +1266,9 @@ DepList::add_predeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
if (dl_deps_pre == opt)
throw;
else
- Log::get_instance()->message(ll_warning, lc_context, "Dropping " + s + " dependencies to "
- "post dependencies because of exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("dep_list.dropping_dependencies", ll_warning, lc_context)
+ << "Dropping " << s << " dependencies to post dependencies because of exception '"
+ << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -1300,8 +1300,8 @@ DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
if (dl_deps_try_post != opt)
throw;
else
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring " + s +
- " dependencies due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("dep_list.ignoring_dependencies", ll_warning, lc_context)
+ << "Ignoring " << s << " dependencies due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
diff --git a/paludis/dep_spec_flattener.cc b/paludis/dep_spec_flattener.cc
index 7005502..3b39a82 100644
--- a/paludis/dep_spec_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -126,13 +126,13 @@ dep_spec_flattener_internals::VisitNamedSetDepSpec<Heirarchy_, Item_, true>::vis
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("flattener.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
return;
}
if (! this->_imp->recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("flattener.recursive_set", ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
return;
}
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 28a2fa6..dc9e694 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -92,7 +92,7 @@ EnvironmentImplementation::set(const SetName & s) const
tr1::shared_ptr<SetSpecTree::ConstItem> l(local_set(s));
if (l)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Set '" << s << "' is a local set";
+ Log::get_instance()->message("environment_implementation.local_set", ll_debug, lc_context) << "Set '" << s << "' is a local set";
return l;
}
}
@@ -103,7 +103,7 @@ EnvironmentImplementation::set(const SetName & s) const
if (s.data() == "everything" || s.data() == "system" || s.data() == "world" || s.data() == "security"
|| s.data() == "ununused")
{
- Log::get_instance()->message(ll_debug, lc_context) << "Set '" << s << "' is a standard set";
+ Log::get_instance()->message("environment_implementation.standard_set", ll_debug, lc_context) << "Set '" << s << "' is a standard set";
result.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
@@ -117,7 +117,8 @@ EnvironmentImplementation::set(const SetName & s) const
tr1::shared_ptr<SetSpecTree::ConstItem> add((**r)[k::sets_interface()]->package_set(s));
if (add)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Set '" << s << "' found in '" << (*r)->name() << "'";
+ Log::get_instance()->message("environment_implementation.set_found_in_repository", ll_debug, lc_context)
+ << "Set '" << s << "' found in '" << (*r)->name() << "'";
if (! result)
result.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
result->add(add);
@@ -136,7 +137,7 @@ EnvironmentImplementation::set(const SetName & s) const
}
if (! result)
- Log::get_instance()->message(ll_debug, lc_context) << "No match for set '" << s << "'";
+ Log::get_instance()->message("environment_implementation.no_match_for_set", ll_debug, lc_context) << "No match for set '" << s << "'";
return result;
}
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index c75ecf3..aa11d7c 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 e96148a..ea80181 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 8031d33..d785ac2 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 f6c3601..2bdbbff 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 6fa7f48..ea1505a 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 810bdd8..5a03fb2 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 555eb89..6000c02 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 61bd2e6..0948a67 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 8388168..4d71c68 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 f66219c..c6f2ecc 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)));
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index da3e3ef..28bf9e9 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -150,8 +150,8 @@ BashHookFile::run(const Hook & hook) const
{
Context c("When running hook script '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
- stringify(file_name()) + "' for '" + hook.name() + "'");
+ Log::get_instance()->message("hook.bash.starting", ll_debug, lc_no_context) << "Starting hook script '" <<
+ file_name() << "' for '" << hook.name() << "'";
Command cmd(Command("bash '" + stringify(file_name()) + "'")
.with_setenv("ROOT", stringify(_env->root()))
@@ -185,11 +185,11 @@ BashHookFile::run(const Hook & hook) const
exit_status = run_command(cmd);
if (0 == exit_status)
- Log::get_instance()->message(ll_debug, lc_no_context, "Hook '" + stringify(file_name())
- + "' returned success '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("hook.bash.success", ll_debug, lc_no_context) << "Hook '" << file_name()
+ << "' returned success '" << exit_status << "'";
else
- Log::get_instance()->message(ll_warning, lc_no_context, "Hook '" + stringify(file_name())
- + "' returned failure '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("hook.bash.failure", ll_warning, lc_no_context) << "Hook '" << file_name()
+ << "' returned failure '" << exit_status << "'";
return HookResult(exit_status, output);
}
@@ -199,8 +199,8 @@ FancyHookFile::run(const Hook & hook) const
{
Context c("When running hook script '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
- stringify(file_name()) + "' for '" + hook.name() + "'");
+ Log::get_instance()->message("hook.fancy.starting", ll_debug, lc_no_context) << "Starting hook script '"
+ << file_name() << "' for '" << hook.name() << "'";
Command cmd(getenv_with_default("PALUDIS_HOOKER_DIR", LIBEXECDIR "/paludis") +
"/hooker.bash '" + stringify(file_name()) + "' 'hook_run_" + stringify(hook.name()) + "'");
@@ -236,11 +236,11 @@ FancyHookFile::run(const Hook & hook) const
exit_status = run_command(cmd);
if (0 == exit_status)
- Log::get_instance()->message(ll_debug, lc_no_context, "Hook '" + stringify(file_name())
- + "' returned success '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("hook.fancy.success", ll_debug, lc_no_context) << "Hook '" << file_name()
+ << "' returned success '" << exit_status << "'";
else
- Log::get_instance()->message(ll_warning, lc_no_context, "Hook '" + stringify(file_name())
- + "' returned failure '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("hook.fancy.failure", ll_warning, lc_no_context) << "Hook '" << file_name()
+ << "' returned failure '" << exit_status << "'";
return HookResult(exit_status, output);
}
@@ -250,8 +250,8 @@ FancyHookFile::auto_hook_names() const
{
Context c("When querying auto hook names for fancy hook '" + stringify(file_name()) + "':");
- Log::get_instance()->message(ll_debug, lc_no_context) << "Starting hook script '" <<
- file_name() << "' for auto hook names";
+ Log::get_instance()->message("hook.fancy.starting", ll_debug, lc_no_context) << "Starting hook script '" <<
+ file_name() << "' for auto hook names";
Command cmd(getenv_with_default("PALUDIS_HOOKER_DIR", LIBEXECDIR "/paludis") +
"/hooker.bash '" + stringify(file_name()) + "' 'hook_auto_names'");
@@ -278,15 +278,15 @@ FancyHookFile::auto_hook_names() const
{
tr1::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
tokenise_whitespace(output, result->back_inserter());
- Log::get_instance()->message(ll_debug, lc_no_context) << "Hook '" << file_name()
+ Log::get_instance()->message("hook.fancy.success", ll_debug, lc_no_context) << "Hook '" << file_name()
<< "' returned success '" << exit_status << "' for auto hook names, result ("
<< join(result->begin(), result->end(), ", ") << ")";
return result;
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Hook '" + stringify(file_name())
- + "' returned failure '" + stringify(exit_status) + "' for auto hook names");
+ Log::get_instance()->message("hook.fancy.failure", ll_warning, lc_no_context) << "Hook '" << file_name()
+ << "' returned failure '" << exit_status << "' for auto hook names";
return make_shared_ptr(new Sequence<std::string>);
}
}
@@ -306,8 +306,8 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
Context context("When adding dependency class '" + stringify(depend ? "depend" : "after") + "' for hook '"
+ stringify(hook.name()) + "' file '" + stringify(file_name()) + "':");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
- stringify(file_name()) + "' for dependencies of '" + hook.name() + "'");
+ Log::get_instance()->message("hook.fancy.starting_dependencies", ll_debug, lc_no_context)
+ << "Starting hook script '" << file_name() << "' for dependencies of '" << hook.name() << "'";
Command cmd(getenv_with_default("PALUDIS_HOOKER_DIR", LIBEXECDIR "/paludis") +
"/hooker.bash '" + stringify(file_name()) + "' 'hook_" + (depend ? "depend" : "after") + "_" +
@@ -337,8 +337,8 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
if (0 == exit_status)
{
- Log::get_instance()->message(ll_debug, lc_no_context, "Hook dependencies for '" + stringify(file_name())
- + "' returned success '" + stringify(exit_status) + "', result '" + deps + "'");
+ Log::get_instance()->message("hook.fancy.success_dependencies", ll_debug, lc_no_context)
+ << "Hook dependencies for '" << file_name() << "' returned success '" << exit_status << "', result '" << deps << "'";
std::set<std::string> deps_s;
tokenise_whitespace(deps, std::inserter(deps_s, deps_s.end()));
@@ -349,16 +349,16 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
if (g.has_node(*d))
g.add_edge(strip_trailing_string(file_name().basename(), ".hook"), *d, 0);
else if (depend)
- Log::get_instance()->message(ll_warning, lc_context, "Hook dependency '" + stringify(*d) +
- "' for '" + stringify(file_name()) + "' not found");
+ Log::get_instance()->message("hook.fancy.dependency_not_found", ll_warning, lc_context)
+ << "Hook dependency '" << *d << "' for '" << file_name() << "' not found";
else
- Log::get_instance()->message(ll_debug, lc_context, "Hook after '" + stringify(*d) +
- "' for '" + stringify(file_name()) + "' not found");
+ Log::get_instance()->message("hook.fancy.after_not_found", ll_debug, lc_context)
+ << "Hook after '" << *d << "' for '" << file_name() << "' not found";
}
}
else
- Log::get_instance()->message(ll_warning, lc_no_context, "Hook dependencies for '" + stringify(file_name())
- + "' returned failure '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("hook.fancy.failure_dependencies", ll_warning, lc_no_context)
+ << "Hook dependencies for '" << file_name() << "' returned failure '" << exit_status << "'";
}
SoHookFile::SoHookFile(const FSEntry & f, const bool, const Environment * const e) :
@@ -379,7 +379,8 @@ SoHookFile::SoHookFile(const FSEntry & f, const bool, const Environment * const
reinterpret_cast<uintptr_t>(dlsym(_dl, "paludis_hook_run")));
if (! _run)
- Log::get_instance()->message(ll_warning, lc_no_context, ".so hook '" + stringify(f) + "' does not define the paludis_hook_run function");
+ Log::get_instance()->message("hook.so.no_paludis_hook_run", ll_warning, lc_no_context)
+ << ".so hook '" << f << "' does not define the paludis_hook_run function";
_add_dependencies = reinterpret_cast<void (*)(
const Environment *, const Hook &, DirectedGraph<std::string, int> &)>(
@@ -390,7 +391,8 @@ SoHookFile::SoHookFile(const FSEntry & f, const bool, const Environment * const
reinterpret_cast<uintptr_t>(dlsym(_dl, "paludis_hook_auto_phases")));
}
else
- Log::get_instance()->message(ll_warning, lc_no_context, "Opening .so hook '" + stringify(f) + "' failed: " + dlerror());
+ Log::get_instance()->message("hook.so.dlopen_failed", ll_warning, lc_no_context)
+ << "Opening .so hook '" << f << "' failed: " << dlerror();
}
HookResult
@@ -401,8 +403,8 @@ SoHookFile::run(const Hook & hook) const
if (! _run)
return HookResult(0, "");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting .so hook '" +
- stringify(file_name()) + "' for '" + hook.name() + "'");
+ Log::get_instance()->message("hook.so.starting", ll_debug, lc_no_context) << "Starting .so hook '" <<
+ file_name() << "' for '" << hook.name() << "'";
return _run(_env, hook);
}
@@ -485,7 +487,7 @@ namespace paludis
n != n_end ; ++n)
{
if (! auto_hook_files[*n].insert(std::make_pair(name, hook_file)).second)
- Log::get_instance()->message(ll_warning, lc_context) << "Discarding hook file '" << *e
+ Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
<< "' in phase '" << *n << "' because of naming conflict with '"
<< auto_hook_files[*n].find(name)->second->file_name() << "'";
}
@@ -563,23 +565,23 @@ Hooker::_find_hooks(const Hook & hook) const
if (is_file_with_extension(*e, ".bash", IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".bash"),
tr1::shared_ptr<HookFile>(new BashHookFile(*e, d->second, _imp->env)))).second)
- Log::get_instance()->message(ll_warning, lc_context, "Discarding hook file '" + stringify(*e)
- + "' because of naming conflict with '" + stringify(
- hook_files.find(stringify(strip_trailing_string(e->basename(), ".bash")))->second->file_name()) + "'");
+ Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
+ << "' because of naming conflict with '" <<
+ hook_files.find(stringify(strip_trailing_string(e->basename(), ".bash")))->second->file_name() << "'";
if (is_file_with_extension(*e, ".hook", IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".hook"),
tr1::shared_ptr<HookFile>(new FancyHookFile(*e, d->second, _imp->env)))).second)
- Log::get_instance()->message(ll_warning, lc_context, "Discarding hook file '" + stringify(*e)
- + "' because of naming conflict with '" + stringify(
- hook_files.find(stringify(strip_trailing_string(e->basename(), ".hook")))->second->file_name()) + "'");
+ Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
+ << "' because of naming conflict with '" <<
+ hook_files.find(stringify(strip_trailing_string(e->basename(), ".hook")))->second->file_name() << "'";
if (is_file_with_extension(*e, so_suffix, IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), so_suffix),
tr1::shared_ptr<HookFile>(new SoHookFile(*e, d->second, _imp->env)))).second)
- Log::get_instance()->message(ll_warning, lc_context, "Discarding hook file '" + stringify(*e)
- + "' because of naming conflict with '" + stringify(
- hook_files.find(stringify(strip_trailing_string(e->basename(), so_suffix)))->second->file_name()) + "'");
+ Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
+ << "' because of naming conflict with '" <<
+ hook_files.find(stringify(strip_trailing_string(e->basename(), so_suffix)))->second->file_name() << "'";
#ifdef ENABLE_PYTHON_HOOKS
if (is_file_with_extension(*e, ".py", IsFileWithOptions()))
@@ -608,16 +610,15 @@ Hooker::_find_hooks(const Hook & hook) const
}
else
{
- Log::get_instance()->message(ll_warning, lc_context,
- "dlsym(libpaludispythonhooks.so, create_py_hook_file) "
- "failed due to error '" + stringify(dlerror()) + "'");
+ Log::get_instance()->message("hook.python.dlerror", ll_warning, lc_context) <<
+ "dlsym(libpaludispythonhooks.so, create_py_hook_file) "
+ "failed due to error '" << dlerror() << "'";
}
}
else
{
- Log::get_instance()->message(ll_warning, lc_context,
- "dlopen(libpaludispythonhooks.so) "
- "failed due to error '" + stringify(dlerror()) + "'");
+ Log::get_instance()->message("hook.python.dlerror", ll_warning, lc_context) <<
+ "dlopen(libpaludispythonhooks.so) failed due to error '" << dlerror() << "'";
}
}
}
@@ -626,23 +627,23 @@ Hooker::_find_hooks(const Hook & hook) const
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".py"),
tr1::shared_ptr<HookFile>(pyhookfilehandle.create_py_hook_file_handle(
*e, d->second, _imp->env)))).second)
- Log::get_instance()->message(ll_warning, lc_context,
- "Discarding hook file '" + stringify(*e)
- + "' because of naming conflict with '"
- + stringify(hook_files.find(stringify(strip_trailing_string(
- e->basename(), ".py")))->second->file_name()) + "'");
+ Log::get_instance()->message("hook.discarding", ll_warning, lc_context) <<
+ "Discarding hook file '" << *e
+ << "' because of naming conflict with '"
+ << hook_files.find(stringify(strip_trailing_string(e->basename(), ".py")))->second->file_name()
+ << "'";
}
}
#elif ENABLE_PYTHON
if (is_file_with_extension(*e, ".py", IsFileWithOptions()))
{
- Log::get_instance()->message(ll_warning, lc_context) << "Ignoring hook '" << *e << "' because"
+ Log::get_instance()->message("hook.python.ignoring", ll_warning, lc_context) << "Ignoring hook '" << *e << "' because"
<< " Paludis was built using a dev-libs/boost version older than 1.34.0.";
}
#else
if (is_file_with_extension(*e, ".py", IsFileWithOptions()))
{
- Log::get_instance()->message(ll_warning, lc_context) << "Ignoring hook '" << *e << "' because"
+ Log::get_instance()->message("hook.python.ignoring", ll_warning, lc_context) << "Ignoring hook '" << *e << "' because"
<< " Paludis was built without Python support (also needs >=dev-libs/boost-1.34.0).";
}
#endif
@@ -670,10 +671,10 @@ Hooker::_find_hooks(const Hook & hook) const
}
catch (const NoGraphTopologicalOrderExistsError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Could not resolve dependency order for hook '"
- + hook.name() + "' due to exception '" + e.message() + "' (" + e.what() + "'), skipping hooks '" +
- join(e.remaining_nodes()->begin(), e.remaining_nodes()->end(), "', '") + "' and using hooks '" + join(ordered.begin(),
- ordered.end(), "', '") + "' in that order");;
+ Log::get_instance()->message("hook.cycles", ll_warning, lc_context) << "Could not resolve dependency order for hook '"
+ << hook.name() << "' due to exception '" << e.message() << "' (" << e.what() << "'), skipping hooks '" <<
+ join(e.remaining_nodes()->begin(), e.remaining_nodes()->end(), "', '") << "' and using hooks '" << join(ordered.begin(),
+ ordered.end(), "', '") << "' in that order";
}
}
@@ -691,7 +692,7 @@ Hooker::perform_hook(const Hook & hook) const
HookResult result(0, "");
Context context("When triggering hook '" + hook.name() + "':");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook '" + hook.name() + "'");
+ Log::get_instance()->message("hook.starting", ll_debug, lc_no_context) << "Starting hook '" << hook.name() << "'";
/* repo hooks first */
@@ -723,7 +724,7 @@ Hooker::perform_hook(const Hook & hook) const
return tmp;
}
else
- Log::get_instance()->message(ll_warning, lc_context)
+ Log::get_instance()->message("hook.bad_output", ll_warning, lc_context)
<< "Hook returned invalid output: '" << tmp.output << "'";
}
}
@@ -756,8 +757,8 @@ Hooker::perform_hook(const Hook & hook) const
if ((*f)->file_name().is_regular_file_or_symlink_to_regular_file())
result.max_exit_status = std::max(result.max_exit_status, (*f)->run(hook).max_exit_status);
else
- Log::get_instance()->message(ll_warning, lc_context, "Hook file '" +
- stringify((*f)->file_name()) + "' is not a regular file or has been removed");
+ Log::get_instance()->message("hook.not_regular_file", ll_warning, lc_context) << "Hook file '" <<
+ (*f)->file_name() << "' is not a regular file or has been removed";
continue;
case hod_grab:
@@ -766,8 +767,8 @@ Hooker::perform_hook(const Hook & hook) const
{
if (! (*f)->file_name().is_regular_file_or_symlink_to_regular_file())
{
- Log::get_instance()->message(ll_warning, lc_context, "Hook file '" +
- stringify((*f)->file_name()) + "' is not a regular file or has been removed");
+ Log::get_instance()->message("hook.not_regular_file", ll_warning, lc_context) << "Hook file '" <<
+ (*f)->file_name() << "' is not a regular file or has been removed";
continue;
}
@@ -782,7 +783,7 @@ Hooker::perform_hook(const Hook & hook) const
return tmp;
}
else
- Log::get_instance()->message(ll_warning, lc_context)
+ Log::get_instance()->message("hook.bad_output", ll_warning, lc_context)
<< "Hook returned invalid output: '" << tmp.output << "'";
}
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 500ba0c..8c44645 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -403,7 +403,7 @@ InstallTask::_add_target(const std::string & target)
if (! done)
{
- Log::get_instance()->message(ll_debug, lc_context) << "target '" << target << "' is a package";
+ Log::get_instance()->message("install_task.target_is_package", ll_debug, lc_context) << "target '" << target << "' is a package";
if (_imp->had_set_targets)
{
@@ -1331,13 +1331,14 @@ namespace
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("install_task.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
return;
}
if (! recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("install_task.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
@@ -1542,13 +1543,14 @@ namespace
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("install_task.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
return;
}
if (! recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("install_task.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 162bd40..c77eab8 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -109,8 +109,8 @@ Merger::merge()
Hook("merger_install_pre")
("INSTALL_SOURCE", stringify(_params[k::image()]))
("INSTALL_DESTINATION", stringify(_params[k::root()])))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(_params[k::image()]) + "' to '" + stringify(_params[k::root()]) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.pre_hooks.failure", ll_warning, lc_context) <<
+ "Merge of '" << _params[k::image()] << "' to '" << _params[k::root()] << "' pre hooks returned non-zero";
/* special handling for install_under */
{
@@ -137,8 +137,8 @@ Merger::merge()
Hook("merger_install_post")
("INSTALL_SOURCE", stringify(_params[k::image()]))
("INSTALL_DESTINATION", stringify(_params[k::root()])))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(_params[k::image()]) + "' to '" + stringify(_params[k::root()]) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.post_hooks.failure", ll_warning, lc_context) <<
+ "Merge of '" << _params[k::image()] << "' to '" << _params[k::root()] << "' post hooks returned non-zero";
}
EntryType
@@ -179,7 +179,7 @@ Merger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst
if (is_check && d == d_end && dst != _params[k::root()].realpath())
{
if (_params[k::options()][mo_allow_empty_dirs])
- Log::get_instance()->message(ll_warning, lc_context) << "Installing empty directory '"
+ Log::get_instance()->message("merger.empty_directory", ll_warning, lc_context) << "Installing empty directory '"
<< stringify(dst) << "'";
else
on_error(is_check, "Attempted to install empty directory '" + stringify(dst) + "'");
@@ -248,7 +248,7 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
.grab_output(Hook::AllowedOutputValues()("skip")))));
if (hr.max_exit_status != 0)
- Log::get_instance()->message(ll_warning, lc_context) << "Merge of '"
+ Log::get_instance()->message("merger.file.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
<< stringify(src) << "' to '" << stringify(dst) << "' skip hooks returned non-zero";
else if (hr.output == "skip")
{
@@ -320,7 +320,7 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
.grab_output(Hook::AllowedOutputValues()("skip")))));
if (hr.max_exit_status != 0)
- Log::get_instance()->message(ll_warning, lc_context) << "Merge of '"
+ Log::get_instance()->message("merger.dir.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
<< stringify(src) << "' to '" << stringify(dst) << "' skip hooks returned non-zero";
else if (hr.output == "skip")
{
@@ -394,7 +394,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
.grab_output(Hook::AllowedOutputValues()("skip")))));
if (hr.max_exit_status != 0)
- Log::get_instance()->message(ll_warning, lc_context) << "Merge of '"
+ Log::get_instance()->message("merger.sym.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
<< stringify(src) << "' to '" << stringify(dst) << "' skip hooks returned non-zero";
else if (hr.output == "skip")
{
@@ -638,8 +638,8 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
Hook("merger_install_file_pre")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.file.pre_hooks.failure", ll_warning, lc_context) <<
+ "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
FSEntry dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
FSEntry dst_real(dst_dir / dst_name);
@@ -696,17 +696,16 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
result += msi_as_hardlink;
break;
}
- Log::get_instance()->message(ll_debug, lc_context,
- "link(" + i->second + ", " + stringify(dst_real) + ") failed: "
- + stringify(::strerror(errno)));
+ Log::get_instance()->message("merger.file.link_failed", ll_debug, lc_context)
+ << "link(" << i->second << ", " << dst_real << ") failed: "
+ << ::strerror(errno);
}
}
if (do_copy)
{
- Log::get_instance()->message(ll_debug, lc_context,
- "rename/link failed: " + stringify(::strerror(errno))
- + ". Falling back to regular read/write copy");
+ Log::get_instance()->message("merger.file.will_copy", ll_debug, lc_context) <<
+ "rename/link failed: " << ::strerror(errno) << ". Falling back to regular read/write copy";
FDHolder input_fd(::open(stringify(src).c_str(), O_RDONLY), false);
if (-1 == input_fd)
throw MergerError("Cannot read '" + stringify(src) + "': " + stringify(::strerror(errno)));
@@ -742,8 +741,8 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
Hook("merger_install_file_post")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.file.post_hooks.failed", ll_warning, lc_context) <<
+ "Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
return result;
}
@@ -769,8 +768,8 @@ Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
FSEntry dst(src.readlink());
std::string fixed_dst(stringify(dst.strip_leading(real_image)));
- Log::get_instance()->message(ll_qa, lc_context, "Rewriting bad symlink: "
- + stringify(src) + " -> " + stringify(dst) + " to " + fixed_dst);
+ Log::get_instance()->message("merger.rewriting_symlink", ll_qa, lc_context) << "Rewriting bad symlink: "
+ << src << " -> " << dst << " to " << fixed_dst;
FSEntry s(dst_dir / src.basename());
s.unlink();
@@ -862,8 +861,8 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
Hook("merger_install_dir_pre")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.dir.pre_hooks.failure", ll_warning, lc_context)
+ << "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
mode_t mode(src.permissions());
uid_t dest_uid(src.owner());
@@ -909,7 +908,8 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
}
else
{
- Log::get_instance()->message(ll_debug, lc_context, "rename failed. Falling back to recursive copy.");
+ Log::get_instance()->message("merger.dir.rename_failed", ll_debug, lc_context) <<
+ "rename failed. Falling back to recursive copy.";
dst.mkdir(mode);
if (! _params[k::no_chown()])
dst.chown(dest_uid, dest_gid);
@@ -921,8 +921,8 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
Hook("merger_install_dir_post")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.dir.post_hooks.failure", ll_warning, lc_context)
+ << "Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
return result;
}
@@ -940,8 +940,8 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
Hook("merger_install_sym_pre")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.sym.pre_hooks.failure", ll_warning, lc_context)
+ << "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
uid_t dest_uid(src.owner() == _params[k::environment()]->reduced_uid() ? 0 : src.owner());
gid_t dest_gid(src.group() == _params[k::environment()]->reduced_gid() ? 0 : src.group());
@@ -967,9 +967,9 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
result += msi_as_hardlink;
break;
}
- Log::get_instance()->message(ll_debug, lc_context,
- "link(" + i->second + ", " + stringify(dst) + ") failed: "
- + stringify(::strerror(errno)));
+ Log::get_instance()->message("merger.sym.link_failed", ll_debug, lc_context)
+ << "link(" << i->second + ", " << stringify(dst) << ") failed: "
+ << ::strerror(errno);
}
}
@@ -993,8 +993,8 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
Hook("merger_install_sym_post")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.sym.post_hooks.failure", ll_warning, lc_context) <<
+ "Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
return result;
}
@@ -1005,8 +1005,8 @@ Merger::unlink_file(FSEntry d)
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_file_pre")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_file.pre_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' pre hooks returned non-zero";
if (d.is_regular_file())
{
@@ -1023,8 +1023,8 @@ Merger::unlink_file(FSEntry d)
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_file_post")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_file.post_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' post hooks returned non-zero";
}
void
@@ -1033,16 +1033,16 @@ Merger::unlink_sym(FSEntry d)
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_sym_pre")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_sym.pre_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' pre hooks returned non-zero";
d.unlink();
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_sym_post")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_sym.post_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' post hooks returned non-zero";
}
void
@@ -1051,16 +1051,16 @@ Merger::unlink_dir(FSEntry d)
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_dir_pre")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_dir.pre_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' pre hooks returned non-zero";
d.rmdir();
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_dir_post")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_dir.post_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' post hooks returned non-zero";
}
void
@@ -1069,16 +1069,16 @@ Merger::unlink_misc(FSEntry d)
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_misc_pre")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' pre hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_misc.pre_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' pre hooks returned non-zero";
d.unlink();
if (0 != _params[k::environment()]->perform_hook(extend_hook(
Hook("merger_unlink_misc_post")
("UNLINK_TARGET", stringify(d)))).max_exit_status)
- Log::get_instance()->message(ll_warning, lc_context,
- "Unmerge of '" + stringify(d) + "' post hooks returned non-zero");
+ Log::get_instance()->message("merger.unlink_misc.post_hooks.failure", ll_warning, lc_context) <<
+ "Unmerge of '" << d << "' post hooks returned non-zero";
}
Hook
diff --git a/paludis/name.cc b/paludis/name.cc
index 7fce6ad..f3f936d 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -431,8 +431,8 @@ namespace
if (o[iufpo_strict_parsing])
throw IUseFlagNameError(s, "+/- prefixed IUSE flag names not allowed in this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context,
- "+/- prefixed IUSE flag names not allowed in this EAPI");
+ Log::get_instance()->message("name.iuse.prefix_not_allowed", ll_warning, lc_context)
+ << "+/- prefixed IUSE flag names not allowed in this EAPI";
}
return '-' == s[0] ? use_disabled : use_enabled;
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 8fa90b0..bdd8a1e 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -162,8 +162,8 @@ NDBAM::category_names()
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping directory '" << *d << "' due to exception '"
- << e.message() << "' (" << e.what() << ")";
+ Log::get_instance()->message("ndbam.categories.skipping", ll_warning, lc_context) <<
+ "Skipping directory '" << *d << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -207,8 +207,8 @@ NDBAM::package_names(const CategoryNamePart & c)
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping directory '" << *d << "' due to exception '"
- << e.message() << "' (" << e.what() << ")";
+ Log::get_instance()->message("ndbam.packages.skipping", ll_warning, lc_context)
+ << "Skipping directory '" << *d << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -314,7 +314,7 @@ NDBAM::entries(const QualifiedPackageName & q)
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(d->basename(), ":", "", std::back_inserter(tokens));
if (tokens.size() < 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Not using '" << *d <<
+ Log::get_instance()->message("ndbam.ids.ignoring", ll_warning, lc_context) << "Not using '" << *d <<
"', since it contains less than three ':'s";
continue;
}
@@ -337,7 +337,7 @@ NDBAM::entries(const QualifiedPackageName & q)
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping directory '" << *d << "' due to exception '"
+ Log::get_instance()->message("ndbam.ids.skipping", ll_warning, lc_context) << "Skipping directory '" << *d << "' due to exception '"
<< e.message() << "' (" << e.what() << ")";
}
}
@@ -368,7 +368,8 @@ NDBAM::parse_contents(const PackageID & id,
FSEntry ff(id.fs_location_key()->value() / "contents");
if (! ff.is_regular_file_or_symlink_to_regular_file())
{
- Log::get_instance()->message(ll_warning, lc_context) << "Contents file '" << ff << "' not a regular file, skipping";
+ Log::get_instance()->message("ndbam.contents.skipping", ll_warning, lc_context)
+ << "Contents file '" << ff << "' not a regular file, skipping";
return;
}
@@ -384,7 +385,8 @@ NDBAM::parse_contents(const PackageID & id,
std::string::size_type q(line->find('=', p));
if (std::string::npos == q)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Malformed line '" << *line << "' in '" << ff << "'";
+ Log::get_instance()->message("ndbam.contents.invalid", ll_warning, lc_context)
+ << "Malformed line '" << *line << "' in '" << ff << "'";
error = true;
continue;
}
@@ -398,7 +400,8 @@ NDBAM::parse_contents(const PackageID & id,
++p;
if (p >= line->length() || std::string::npos == p)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Malformed line '" << *line << "' in '" << ff << "'";
+ Log::get_instance()->message("ndbam.contents.invalid", ll_warning, lc_context)
+ << "Malformed line '" << *line << "' in '" << ff << "'";
error = true;
break;
}
@@ -411,8 +414,8 @@ NDBAM::parse_contents(const PackageID & id,
else if (' ' == (*line)[p])
{
if (! tokens.insert(std::make_pair(key, value)).second)
- Log::get_instance()->message(ll_warning, lc_context) << "Duplicate token '" << key << "' on line '"
- << *line << "' in '" << ff << "'";
+ Log::get_instance()->message("ndbam.contents.duplicate", ll_warning, lc_context)
+ << "Duplicate token '" << key << "' on line '" << *line << "' in '" << ff << "'";
key.clear();
value.clear();
++p;
@@ -428,8 +431,8 @@ NDBAM::parse_contents(const PackageID & id,
if ((! error) && (! key.empty()))
{
if (! tokens.insert(std::make_pair(key, value)).second)
- Log::get_instance()->message(ll_warning, lc_context) << "Duplicate token '" << key << "' on line '"
- << *line << "' in '" << ff << "'";
+ Log::get_instance()->message("ndbam.contents.duplicate", ll_warning, lc_context)
+ << "Duplicate token '" << key << "' on line '" << *line << "' in '" << ff << "'";
}
}
@@ -438,7 +441,7 @@ NDBAM::parse_contents(const PackageID & id,
if (! tokens.count("type"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.type", ll_warning, lc_context) <<
"No key 'type' found on line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -446,7 +449,7 @@ NDBAM::parse_contents(const PackageID & id,
if (! tokens.count("path"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.path", ll_warning, lc_context) <<
"No key 'path' found on line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -456,7 +459,7 @@ NDBAM::parse_contents(const PackageID & id,
{
if (! tokens.count("md5"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.md5", ll_warning, lc_context) <<
"No key 'md5' found on sym line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -464,7 +467,7 @@ NDBAM::parse_contents(const PackageID & id,
if (! tokens.count("mtime"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.mtime", ll_warning, lc_context) <<
"No key 'mtime' found on sym line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -480,7 +483,7 @@ NDBAM::parse_contents(const PackageID & id,
{
if (! tokens.count("target"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.target", ll_warning, lc_context) <<
"No key 'target' found on sym line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -488,7 +491,7 @@ NDBAM::parse_contents(const PackageID & id,
if (! tokens.count("mtime"))
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.no_key.mtime", ll_warning, lc_context) <<
"No key 'mtime' found on sym line '" << *line << "' in '" << ff << "'";
continue;
}
@@ -497,7 +500,7 @@ NDBAM::parse_contents(const PackageID & id,
on_sym(path, target, mtime);
}
else
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("ndbam.contents.unknown_type", ll_warning, lc_context) <<
"Unknown type '" << type << "' found on line '" << *line << "' in '" << ff << "'";
}
}
@@ -539,7 +542,8 @@ NDBAM::category_names_containing_package(const PackageNamePart & p) const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping directory '" << *d << "' due to exception '"
+ Log::get_instance()->message("ndbam.categories.skipping", ll_warning, lc_context)
+ << "Skipping directory '" << *d << "' due to exception '"
<< e.message() << "' (" << e.what() << ")";
}
}
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index 5025cf6..e21c558 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -210,7 +210,7 @@ void
NDBAMMerger::on_warn(bool is_check, const std::string & s)
{
if (is_check)
- Log::get_instance()->message(ll_warning, lc_context, s);
+ Log::get_instance()->message("merger.ndbam.warning", ll_warning, lc_context) << s;
}
bool
diff --git a/paludis/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc
index 5a0a062..d7de7cb 100644
--- a/paludis/ndbam_unmerger.cc
+++ b/paludis/ndbam_unmerger.cc
@@ -226,8 +226,8 @@ NDBAMUnmerger::check_file(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) cons
std::ifstream md5_file(stringify(_imp->options.root / f).c_str());
if (! md5_file)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot get md5 for '" +
- stringify(_imp->options.root / f) + "'");
+ Log::get_instance()->message("ndbam.unmerger.md5_failed", ll_warning, lc_no_context) << "Cannot get md5 for '" <<
+ (_imp->options.root / f) << "'";
display("--- [!md5?] " + stringify(f));
}
else if (MD5(md5_file).hexsum() != fie->_md5sum)
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index ee7b960..ae6f2dc 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 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
@@ -313,7 +313,7 @@ PackageDatabase::fetch_unique_qualified_package_name(
first_iterator(result->end()));
} while (false);
- Log::get_instance()->message(ll_warning, lc_context)
+ Log::get_instance()->message("package_database.ambiguous_name", ll_warning, lc_context)
<< "Package name '" << p << "' is ambiguous, assuming you meant '" << *qpns.begin()
<< "' (candidates were '"
<< join(first_iterator(result->begin()), first_iterator(result->end()), "', '") << "')";
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index e915fda..59eb7e4 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -119,14 +119,15 @@ PyHookFile::PyHookFile(const FSEntry & f, const bool r, const Environment * cons
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Initializing Python interpreter failed:");
+ Log::get_instance()->message("hook.python.interpreter_failure", ll_warning, lc_no_context)
+ << "Initializing Python interpreter failed:";
PyErr_Print();
return;
}
catch (const std::exception & ex)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- std::string("Initializing Python interpreter failed: '") + ex.what() + "'");
+ Log::get_instance()->message("hook.python.interpreter_failure", ll_warning, lc_no_context)
+ << "Initializing Python interpreter failed: '" << ex.what() << "'";
return;
}
}
@@ -139,13 +140,13 @@ PyHookFile::PyHookFile(const FSEntry & f, const bool r, const Environment * cons
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Loading hook '" + stringify(f) + "' failed: '"
- + _get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context)
+ << "Loading hook '" << f << "' failed: '" << _get_traceback() << "'";
}
catch (const std::exception & ex)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Loading hook '" + stringify(f) + "' failed: '"
- + ex.what() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context)
+ << "Loading hook '" << f << "' failed: '" << ex.what() << "'";
}
}
@@ -169,16 +170,16 @@ PyHookFile::run(const Hook & hook) const
{
if (PyErr_ExceptionMatches(PyExc_KeyError))
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "' does not define the hook_run_"
- + hook.name() + " function");
+ Log::get_instance()->message("hook.python.undefined", ll_warning, lc_no_context)
+ << "Hook '" << file_name() << "' does not define the hook_run_"
+ << hook.name() << " function";
PyErr_Clear();
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "' failed unexpectedly: '"
- + _get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context) <<
+ "Hook '" << file_name() << "' failed unexpectedly: '"
+ << _get_traceback() << "'";
}
return HookResult(1, "");
@@ -186,8 +187,8 @@ PyHookFile::run(const Hook & hook) const
Prefix p(this, _run_prefixed ? strip_trailing_string(file_name().basename(), ".py") + "> " : "");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook '" +
- stringify(file_name()) + "' for '" + hook.name() + "'");
+ Log::get_instance()->message("hook.python.starting", ll_debug, lc_no_context)
+ << "Starting hook '" << file_name() << "' for '" << hook.name() << "'";
bp::dict hook_env;
hook_env["HOOK"] = hook.name();
@@ -203,9 +204,9 @@ PyHookFile::run(const Hook & hook) const
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "': running hook_run_" + hook.name()
- + " function failed: '" + _get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context) <<
+ "Hook '" << file_name() << "': running hook_run_" << hook.name()
+ << " function failed: '" << _get_traceback() << "'";
return HookResult(1, "");
}
@@ -215,17 +216,17 @@ PyHookFile::run(const Hook & hook) const
{
std::string result_s = bp::extract<std::string>(result);
- Log::get_instance()->message(ll_debug, lc_no_context,
- "Hook '" + stringify(file_name()) + "': hook_run_" + hook.name()
- + " function returned '" + result_s + "'");
+ Log::get_instance()->message("hook.python.output", ll_debug, lc_no_context)
+ << "Hook '" << file_name() << "': hook_run_" << hook.name()
+ << " function returned '" << result_s << "'";
return HookResult(0, result_s);
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "': hook_run_" + hook.name()
- + " function returned not a string.");
+ Log::get_instance()->message("hook.python.bad_output", ll_warning, lc_no_context)
+ << "Hook '" << file_name() << "': hook_run_" << hook.name()
+ << " function returned not a string.";
return HookResult(1, "");
}
}
@@ -265,16 +266,15 @@ PyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::string,
{
if (PyErr_ExceptionMatches(PyExc_KeyError))
{
- Log::get_instance()->message(ll_debug, lc_no_context,
- "Hook '" + stringify(file_name()) + "' does not define the hook_"
- + stringify(depend ? "depend" : "after") + "_" + hook.name() + " function");
+ Log::get_instance()->message("hook.python.undefined", ll_debug, lc_no_context)
+ << "Hook '" << file_name() << "' does not define the hook_"
+ << (depend ? "depend" : "after") << "_" << hook.name() << " function";
PyErr_Clear();
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "' failed unexpectedly: '"
- + _get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context)
+ << "Hook '" << file_name() << "' failed unexpectedly: '" << _get_traceback() << "'";
}
return;
@@ -294,10 +294,10 @@ PyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::string,
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "': running hook_"
- + stringify(depend ? "depend" : "after") + "_" + hook.name() + " function failed: '"
- + _get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context) <<
+ "Hook '" << file_name() << "': running hook_"
+ << (depend ? "depend" : "after") << "_" << hook.name() << " function failed: '"
+ << _get_traceback() << "'";
return;
}
@@ -319,26 +319,26 @@ PyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::string,
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "': hook_"
- + stringify(depend ? "depend" : "after") + "_" + hook.name()
- + " function returned not a list of strings: '" + deps + "'");
+ Log::get_instance()->message("hook.python.bad_output", ll_warning, lc_no_context)
+ << "Hook '" << file_name() << "': hook_"
+ << stringify(depend ? "depend" : "after") << "_" << hook.name()
+ << " function returned not a list of strings: '" << deps << "'";
return;
}
}
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(file_name()) + "': hook_"
- + stringify(depend ? "depend" : "after") + "_" + hook.name()
- + " function returned not a list: '" + deps + "'");
+ Log::get_instance()->message("hook.python.bad_output", ll_warning, lc_no_context)
+ << "Hook '" << file_name() << "': hook_"
+ << (depend ? "depend" : "after") << "_" << hook.name()
+ << " function returned not a list: '" << deps << "'";
return;
}
- Log::get_instance()->message(ll_debug, lc_no_context,
- "Hook '" + stringify(file_name()) + "': hook_"
- + stringify(depend ? "depend" : "after") + "_" + hook.name() + " function returned '" + deps + "'");
+ Log::get_instance()->message("hook.python.output", ll_debug, lc_no_context)
+ << "Hook '" << file_name() << "': hook_"
+ << stringify(depend ? "depend" : "after") << "_" << hook.name() << " function returned '" << deps << "'";
for (std::set<std::string>::const_iterator d(deps_s.begin()), d_end(deps_s.end()) ;
d != d_end ; ++d)
@@ -346,11 +346,11 @@ PyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::string,
if (g.has_node(*d))
g.add_edge(strip_trailing_string(file_name().basename(), ".py"), *d, 0);
else if (depend)
- Log::get_instance()->message(ll_warning, lc_context, "Hook dependency '" + stringify(*d) +
- "' for '" + stringify(file_name()) + "' not found");
+ Log::get_instance()->message("hook.python.dependency_not_found", ll_warning, lc_context)
+ << "Hook dependency '" << *d << "' for '" << file_name() << "' not found";
else
- Log::get_instance()->message(ll_debug, lc_context, "Hook after '" + stringify(*d) +
- "' for '" + stringify(file_name()) + "' not found");
+ Log::get_instance()->message("hook.python.after_not_found", ll_debug, lc_context)
+ << "Hook after '" << *d << "' for '" << file_name() << "' not found";
}
}
@@ -363,9 +363,9 @@ PyHookFile::Prefix::Prefix(const PyHookFile * const f, const std::string & prefi
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(phf->file_name()) + "' failed unexpectedly: '"
- + phf->_get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context)
+ << "Hook '" << phf->file_name() << "' failed unexpectedly: '"
+ << phf->_get_traceback() << "'";
}
}
@@ -377,9 +377,9 @@ PyHookFile::Prefix::~Prefix()
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Hook '" + stringify(phf->file_name()) + "' failed unexpectedly: '"
- + phf->_get_traceback() + "'");
+ Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context)
+ << "Hook '" << phf->file_name() << "' failed unexpectedly: '"
+ << phf->_get_traceback() << "'";
}
}
@@ -405,8 +405,8 @@ PyHookFile::_get_traceback() const
if (result == NULL)
{
- Log::get_instance()->message(ll_warning, lc_context,
- "Hook '" + stringify(file_name()) + "': _get_traceback(): traceback.format_exception failed");
+ Log::get_instance()->message("hook.python.traceback_failed", ll_warning, lc_context) <<
+ "Hook '" << file_name() << "': _get_traceback(): traceback.format_exception failed";
return "Getting traceback failed";
}
@@ -417,8 +417,8 @@ PyHookFile::_get_traceback() const
}
else
{
- Log::get_instance()->message(ll_warning, lc_context,
- "Hook '" + stringify(file_name()) + "': _get_traceback(): cannot extract list of lines");
+ Log::get_instance()->message("hook.python.traceback_failed", ll_warning, lc_context) <<
+ "Hook '" << file_name() << "': _get_traceback(): cannot extract list of lines";
return "Getting traceback failed";
}
@@ -429,8 +429,8 @@ PyHookFile::_get_traceback() const
}
catch (const bp::error_already_set &)
{
- Log::get_instance()->message(ll_warning, lc_context,
- "Hook '" + stringify(file_name()) + "': _get_traceback(): joining list of lines failed");
+ Log::get_instance()->message("hook.python.traceback_failed", ll_warning, lc_context) <<
+ "Hook '" << file_name() << "': _get_traceback(): joining list of lines failed";
return "Getting traceback failed";
}
diff --git a/paludis/query_visitor.cc b/paludis/query_visitor.cc
index b5ed42e..6bce7e4 100644
--- a/paludis/query_visitor.cc
+++ b/paludis/query_visitor.cc
@@ -111,14 +111,15 @@ QueryVisitor::visit_leaf(const NamedSetDepSpec & s)
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("dep_list.query_visitor.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
_imp->result = false;
return;
}
if (! _imp->recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("dep_list.query_visitor.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index 8b27792..c24a268 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -67,13 +67,14 @@ namespace
tr1::shared_ptr<const SetSpecTree::ConstItem> set(_env.set(s.name()));
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("report_task.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
return;
}
if (! _recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("report_task.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
@@ -154,8 +155,8 @@ ReportTask::execute()
{
if (once)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Skipping GLSA checks because Paludis was built without XML support");
+ Log::get_instance()->message("report_task.skipping_glsas", ll_warning, lc_no_context)
+ << "Skipping GLSA checks because Paludis was built without XML support";
once = false;
}
}
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index b491254..e5e5a8e 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -118,7 +118,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
if (! f.is_regular_file())
{
add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "DESCRIPTION file not a file")));
- Log::get_instance()->message(ll_warning, lc_context) << "Unexpected irregular file: '" << stringify(f) << "'";
+ Log::get_instance()->message("cran.id.not_a_file", ll_warning, lc_context) << "Unexpected irregular file: '" << stringify(f) << "'";
return;
}
@@ -145,7 +145,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
}
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "No Package: or Bundle: key in '" << stringify(f) << "'";
+ Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "No Package: or Bundle: key in '" << stringify(f) << "'";
add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "No Package: or Bundle: key")));
return;
}
@@ -153,7 +153,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
if (file.get("Version").empty())
{
Context local_context("When handling Version: key:");
- Log::get_instance()->message(ll_warning, lc_context) << "No Version: key in '" << stringify(f) << "'";
+ Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "No Version: key in '" << stringify(f) << "'";
_imp->version = VersionSpec("0");
add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "No Version: key")));
return;
@@ -234,8 +234,8 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
else
{
/* yay CRAN... */
- Log::get_instance()->message(ll_qa, lc_context) << "Bundle '" << stringify(*this) << "' contains itself, but is "
- "not a Klein bundle";
+ Log::get_instance()->message("cran.bundle.recursive", ll_qa, lc_context)
+ << "Bundle '" << stringify(*this) << "' contains itself, but is not a Klein bundle";
}
}
}
@@ -271,7 +271,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Broken CRAN description file '" << stringify(f) << "': '"
+ Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "Broken CRAN description file '" << stringify(f) << "': '"
<< e.message() << "' (" << e.what() << ")";
add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "Got exception '" + stringify(e.message()) + "' (" + e.what() + "')")));
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index f586578..b5132f3 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -220,14 +220,15 @@ CRANRepository::need_ids() const
tr1::shared_ptr<cranrepository::CRANPackageID> id(new cranrepository::CRANPackageID(_imp->params.environment,
shared_from_this(), *d));
if (! _imp->ids.insert(std::make_pair(id->name(), id)).second)
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't insert package '" << *id << "' due to name collision";
+ Log::get_instance()->message("cran.id.duplicate", ll_warning, lc_context)
+ << "Couldn't insert package '" << *id << "' due to name collision";
if (id->contains_key())
for (PackageIDSequence::ConstIterator i(id->contains_key()->value()->begin()),
i_end(id->contains_key()->value()->end()) ; i != i_end ; ++i)
if (! _imp->ids.insert(std::make_pair((*i)->name(),
tr1::static_pointer_cast<const cranrepository::CRANPackageID>(*i))).second)
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't insert package '" << **i
+ Log::get_instance()->message("cran.id.duplicate", ll_warning, lc_context) << "Couldn't insert package '" << **i
<< "', which is contained in '" << *id << "', due to name collision";
}
@@ -425,7 +426,8 @@ CRANRepository::make_cran_repository(
if (m->end() == m->find("buildroot") || ((builddir = m->find("buildroot")->second)).empty())
builddir = "/var/tmp/paludis";
else
- Log::get_instance()->message(ll_warning, lc_context) << "Key 'buildroot' is deprecated, use 'builddir' instead";
+ Log::get_instance()->message("cran.configuration.deprecated", ll_warning, lc_context)
+ << "Key 'buildroot' is deprecated, use 'builddir' instead";
}
return tr1::shared_ptr<Repository>(new CRANRepository(CRANRepositoryParams::create()
diff --git a/paludis/repositories/cran/description_file.cc b/paludis/repositories/cran/description_file.cc
index 8cbf285..aaa1e02 100644
--- a/paludis/repositories/cran/description_file.cc
+++ b/paludis/repositories/cran/description_file.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
@@ -82,7 +82,7 @@ DescriptionFile::_line(const std::string & l)
{
std::string::size_type p(l.find(':'));
if (std::string::npos == p)
- Log::get_instance()->message(ll_warning, lc_context) << "No colon on line '" << l << "'";
+ Log::get_instance()->message("cran.description.malformed", ll_warning, lc_context) << "No colon on line '" << l << "'";
else
{
std::string key(strip_leading(strip_trailing(l.substr(0, p), " \t"), " \t")),
@@ -96,7 +96,7 @@ DescriptionFile::_line(const std::string & l)
{
std::pair<std::map<std::string, std::string>::iterator, bool> r(_imp->values.insert(std::make_pair(key, value)));
if ((! r.second) && (r.first->second != value))
- Log::get_instance()->message(ll_qa, lc_context) << "Key '" << key << "' already set to '"
+ Log::get_instance()->message("cran.description.duplicate", ll_qa, lc_context) << "Key '" << key << "' already set to '"
<< r.first->second << "', ignoring duplicate key value '" << value << "'";
}
}
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 89280fa..3d7d102 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -183,7 +183,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
{
case manifest_use:
case manifest_ignore:
- Log::get_instance()->message(ll_debug, lc_context) << "Empty or non-existent Manifest file";
+ Log::get_instance()->message("e.manifest.empty", ll_debug, lc_context) << "Empty or non-existent Manifest file";
return true;
case manifest_require:
@@ -211,12 +211,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
continue;
found = true;
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.size", ll_debug, lc_context)
<< "Actual size = " << distfile.file_size()
<< "; Manifest file size = " << m->size;
if (distfile.file_size() != m->size)
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.no_size", ll_debug, lc_context)
<< "Malformed Manifest: no file size found";
std::cout << "incorrect size";
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -246,7 +246,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
RMD160 rmd160sum(file_stream);
if (rmd160sum.hexsum() != m->rmd160)
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.rmd160.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed RMD160 checksum";
std::cout << "failed RMD160";
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -257,7 +257,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
);
return false;
}
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.rmd160.result", ll_debug, lc_context)
<< "Actual RMD160 = " << rmd160sum.hexsum();
file_stream.clear();
file_stream.seekg(0, std::ios::beg);
@@ -268,7 +268,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
SHA1 sha1sum(file_stream);
if (sha1sum.hexsum() != m->sha1)
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.sha1.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed SHA1 checksum";
std::cout << "failed SHA1";
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -279,7 +279,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
);
return false;
}
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.sha1.result", ll_debug, lc_context)
<< "Actual SHA1 = " << sha1sum.hexsum();
file_stream.clear();
file_stream.seekg(0, std::ios::beg);
@@ -290,7 +290,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
SHA256 sha256sum(file_stream);
if (sha256sum.hexsum() != m->sha256)
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.sha256.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed SHA256 checksum";
std::cout << "failed SHA256";
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -301,7 +301,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
);
return false;
}
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.sha256.result", ll_debug, lc_context)
<< "Actual SHA256 = " << sha256sum.hexsum();
file_stream.clear();
file_stream.seekg(0, std::ios::beg);
@@ -312,7 +312,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
MD5 md5sum(file_stream);
if (md5sum.hexsum() != m->md5)
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.md5.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed MD5 checksum";
std::cout << "failed MD5";
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -323,7 +323,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
);
return false;
}
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.manifest.md5.result", ll_debug, lc_context)
<< "Actual MD5 = " << md5sum.hexsum();
}
}
@@ -350,7 +350,8 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
if (_imp->done.end() != _imp->done.find(u.filename()))
{
- Log::get_instance()->message(ll_debug, lc_context) << "Already checked '" << u.filename() << "'";
+ Log::get_instance()->message("e.check_fetched_files.already_checked", ll_debug, lc_context)
+ << "Already checked '" << u.filename() << "'";
return;
}
_imp->done.insert(u.filename());
@@ -361,7 +362,8 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
{
if (_imp->in_nofetch)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Manual fetch required for '" << u.filename() << "'";
+ Log::get_instance()->message("e.check_fetched_files.requires_manual", ll_debug, lc_context)
+ << "Manual fetch required for '" << u.filename() << "'";
std::cout << "requires manual fetch";
_imp->need_nofetch = true;
_imp->failures->push_back(FetchActionFailure::named_create()
@@ -373,7 +375,8 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
}
else
{
- Log::get_instance()->message(ll_debug, lc_context) << "Automatic fetch failed for '" << u.filename() << "'";
+ Log::get_instance()->message("e.check_fetched_files.does_not_exist", ll_debug, lc_context)
+ << "Automatic fetch failed for '" << u.filename() << "'";
std::cout << "does not exist";
_imp->failures->push_back(FetchActionFailure::named_create()
(k::target_file(), u.filename())
@@ -385,7 +388,7 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
}
else if (0 == (_imp->distdir / u.filename()).file_size())
{
- Log::get_instance()->message(ll_debug, lc_context) << "Empty file for '" << u.filename() << "'";
+ Log::get_instance()->message("e.check_fetched_files.empty", ll_debug, lc_context) << "Empty file for '" << u.filename() << "'";
std::cout << "empty file";
_imp->failures->push_back(FetchActionFailure::named_create()
(k::target_file(), u.filename())
@@ -396,12 +399,12 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
}
else if (! check_distfile_manifest(_imp->distdir / u.filename()))
{
- Log::get_instance()->message(ll_debug, lc_context)
+ Log::get_instance()->message("e.check_fetched_files.failure", ll_debug, lc_context)
<< "Manifest check failed for '" << u.filename() << "'";
}
else
{
- Log::get_instance()->message(ll_debug, lc_context) << "Success for '" << u.filename() << "'";
+ Log::get_instance()->message("e.check_fetched_files.success", ll_debug, lc_context) << "Success for '" << u.filename() << "'";
std::cout << "ok";
}
diff --git a/paludis/repositories/e/conditional_dep_spec.cc b/paludis/repositories/e/conditional_dep_spec.cc
index 48f58ba..f5daa5c 100644
--- a/paludis/repositories/e/conditional_dep_spec.cc
+++ b/paludis/repositories/e/conditional_dep_spec.cc
@@ -53,7 +53,7 @@ namespace
id(i)
{
if (! i)
- Log::get_instance()->message(ll_warning, lc_context) << "! i";
+ Log::get_instance()->message("e.conditional_dep_spec.no_id", ll_warning, lc_context) << "! i";
if (s.empty())
throw DepStringParseError(s, "missing use flag name");
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 31e4b33..189a3d6 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -164,7 +164,8 @@ EInstalledRepositoryID::need_keys_added() const
if (! (*eapi())[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "Not loading further keys for '" << *this << "' because EAPI '"
+ Log::get_instance()->message("e.eapi.unsupported", ll_debug, lc_context)
+ << "Not loading further keys for '" << *this << "' because EAPI '"
<< (*eapi())[k::name()] << "' is not supported";
return;
}
@@ -439,7 +440,7 @@ EInstalledRepositoryID::slot() const
_imp->slot.reset(new SlotName(file_contents(_imp->dir / "SLOT")));
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "No SLOT entry in '" << _imp->dir << "', pretending '0'";
+ Log::get_instance()->message("e.no_slot", ll_warning, lc_context) << "No SLOT entry in '" << _imp->dir << "', pretending '0'";
_imp->slot.reset(new SlotName("0"));
}
@@ -466,7 +467,7 @@ EInstalledRepositoryID::eapi() const
_imp->eapi = EAPIData::get_instance()->eapi_from_string(file_contents(_imp->dir / "EAPI"));
else
{
- Log::get_instance()->message(ll_debug, lc_context) << "No EAPI entry in '" << _imp->dir << "', pretending '"
+ Log::get_instance()->message("e.no_eapi", ll_debug, lc_context) << "No EAPI entry in '" << _imp->dir << "', pretending '"
<< _imp->environment->default_distribution() << "'";
_imp->eapi = EAPIData::get_instance()->eapi_from_string(
(*DistributionData::get_instance()->distribution_from_string(
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index bc3a094..f408ce5 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -997,7 +997,7 @@ EContentsKey::value() const
FSEntry f(_imp->filename);
if (! f.is_regular_file_or_symlink_to_regular_file())
{
- Log::get_instance()->message(ll_warning, lc_context) << "CONTENTS lookup failed for request for '" <<
+ Log::get_instance()->message("e.contents.not_a_file", ll_warning, lc_context) << "CONTENTS lookup failed for request for '" <<
*_imp->id << "' using '" << _imp->filename << "'";
return _imp->value;
}
@@ -1015,7 +1015,7 @@ EContentsKey::value() const
std::vector<std::string> tokens;
if (! VDBContentsTokeniser::tokenise(line, std::back_inserter(tokens)))
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "CONTENTS has broken line " <<
+ Log::get_instance()->message("e.contents.broken", ll_warning, lc_no_context) << "CONTENTS has broken line " <<
line_number << ", skipping";
continue;
}
@@ -1083,7 +1083,7 @@ EMTimeKey::value() const
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't get mtime for '"
+ Log::get_instance()->message("e.contents.mtime_failure", ll_warning, lc_context) << "Couldn't get mtime for '"
<< _imp->filename << "' for ID '" << *_imp->id << "' due to exception '" << e.message()
<< "' (" << e.what() << ")";
}
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index e2738cc..0777e58 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -412,8 +412,8 @@ namespace paludis
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Not loading profile '" +
- tokens.at(1) + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.failure", ll_warning, lc_context) << "Not loading profile '"
+ << tokens.at(1) << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -455,9 +455,9 @@ namespace
std::string modified_location(tree_root.basename());
std::replace(modified_location.begin(), modified_location.end(), '/', '-');
- Log::get_instance()->message(ll_qa, lc_no_context, "Couldn't open repo_name file in '"
- + stringify(tree_root) + "/profiles/', falling back to generated name 'x-" + modified_location +
- "' (ignore this message if you have yet to sync this repository).");
+ Log::get_instance()->message("e.repo_name.unusable", ll_qa, lc_no_context)
+ << "Couldn't open repo_name file in '" << tree_root << "/profiles/', falling back to generated name 'x-"
+ << modified_location << "' (ignore this message if you have yet to sync this repository).";
return RepositoryName("x-" + modified_location);
}
@@ -587,9 +587,9 @@ ERepository::repository_masked(const PackageID & id) const
if (a->package_ptr())
_imp->repo_mask[*a->package_ptr()].push_back(std::make_pair(a, line->second));
else
- Log::get_instance()->message(ll_warning, lc_context, "Loading package mask spec '"
- + stringify(line->first) + "' failed because specification does not restrict to a "
- "unique package");
+ Log::get_instance()->message("e.package_mask.bad_spec", ll_warning, lc_context)
+ << "Loading package mask spec '" << line->first << "' failed because specification does not restrict to a "
+ "unique package";
}
catch (const InternalError &)
{
@@ -597,9 +597,9 @@ ERepository::repository_masked(const PackageID & id) const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading package mask spec '"
- + stringify(line->first) + "' failed due to exception '" + e.message() + "' ("
- + e.what() + ")");
+ Log::get_instance()->message("e.package_mask.bad_spec", ll_warning, lc_context) << "Loading package mask spec '"
+ << line->first << "' failed due to exception '" << e.message() << "' ("
+ << e.what() << ")";
}
}
@@ -704,8 +704,9 @@ ERepository::arch_flags() const
if (! found_one)
{
- Log::get_instance()->message(ll_qa, lc_no_context, "Couldn't find arch.list file for repository '"
- + stringify(name()) + "', arch flags may incorrectly show up as unmasked");
+ Log::get_instance()->message("e.arch_list.missing", ll_qa, lc_no_context)
+ << "Couldn't find arch.list file for repository '"
+ << stringify(name()) << "', arch flags may incorrectly show up as unmasked";
}
}
@@ -749,10 +750,10 @@ ERepository::need_mirrors() const
}
if (! found_one)
- Log::get_instance()->message(ll_warning, lc_no_context,
- "No thirdpartymirrors file found in '"
- + stringify(_imp->params.location / "profiles") + "', so mirror:// SRC_URI "
- "components cannot be fetched");
+ Log::get_instance()->message("e.thirdpartymirrors.missing", ll_warning, lc_no_context) <<
+ "No thirdpartymirrors file found in '"
+ << (_imp->params.location / "profiles") << "', so mirror:// SRC_URI "
+ "components cannot be fetched";
_imp->has_mirrors = true;
}
@@ -1041,7 +1042,8 @@ ERepository::set_profile(const ProfilesConstIterator & iter)
{
Context context("When setting profile by iterator:");
- Log::get_instance()->message(ll_debug, lc_context, "Using profile '" + stringify((*iter)[k::path()]) + "'");
+ Log::get_instance()->message("e.profile.using", ll_debug, lc_context)
+ << "Using profile '" << ((*iter)[k::path()]) << "'";
_imp->profile_ptr = (*iter)[k::profile()];
if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment->default_distribution()))
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index c6eb96e..adbecd6 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -112,8 +112,9 @@ ERepositoryNews::update_news() const
if (0 == stringify(_imp->e_repository->name()).compare(0, 2, "x-"))
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot enable GLEP 42 news items for repository '"
- + stringify(_imp->e_repository->name()) + "' because it is using a generated repository name");
+ Log::get_instance()->message("e.news.no_repo_name", ll_warning, lc_context)
+ << "Cannot enable GLEP 42 news items for repository '"
+ << _imp->e_repository->name() << "' because it is using a generated repository name";
return;
}
@@ -165,8 +166,8 @@ ERepositoryNews::update_news() const
std::string profile(strip_leading_string(strip_trailing_string(
strip_leading_string(stringify(p->realpath()),
stringify(p->realpath())), "/"), "/"));
- Log::get_instance()->message(ll_debug, lc_no_context,
- "Profile path is '" + profile + "'");
+ Log::get_instance()->message("e.news.profile_path", ll_debug, lc_no_context) <<
+ "Profile path is '" << profile << "'";
for (NewsFile::DisplayIfProfileConstIterator i(news.begin_display_if_profile()),
i_end(news.end_display_if_profile()) ; i != i_end ; ++i)
if (profile == *i)
@@ -180,18 +181,16 @@ ERepositoryNews::update_news() const
std::ofstream s(stringify(_imp->skip_file).c_str(),
std::ios::out | std::ios::app);
if (! s)
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Cannot append to news skip file '"
- + stringify(_imp->skip_file) +
- "', skipping news item '" + stringify(*d) + "'");
+ Log::get_instance()->message("e.news.skip_file.append_failure", ll_warning, lc_no_context) <<
+ "Cannot append to news skip file '" << _imp->skip_file <<
+ "', skipping news item '" << *d << "'";
std::ofstream t(stringify(_imp->unread_file).c_str(),
std::ios::out | std::ios::app);
if (! t)
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Cannot append to unread file '"
- + stringify(_imp->unread_file) +
- "', skipping news item '" + stringify(*d) + "'");
+ Log::get_instance()->message("e.news.unread_file.append_failure", ll_warning, lc_no_context) <<
+ "Cannot append to unread file '" << _imp->unread_file <<
+ "', skipping news item '" << *d << "'";
if (s && t)
{
@@ -206,10 +205,9 @@ ERepositoryNews::update_news() const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Skipping news item '"
- + stringify(*d) + "' because of exception '" + e.message() + "' ("
- + e.what() + ")");
+ Log::get_instance()->message("e.news.skipping", ll_warning, lc_no_context) <<
+ "Skipping news item '" << *d << "' because of exception '" << e.message() << "' ("
+ << e.what() << ")";
}
}
@@ -247,7 +245,8 @@ NewsFile::NewsFile(const FSEntry & our_filename) :
std::string::size_type p(line->find(':'));
if (std::string::npos == p)
{
- Log::get_instance()->message(ll_warning, lc_context, "Bad header line '" + *line + "'");
+ Log::get_instance()->message("e.news.bad_header", ll_warning, lc_context)
+ << "Bad header line '" << *line << "'";
break;
}
else
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index c178ad1..9b2ef27 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -192,7 +192,7 @@ namespace paludis
if (! p->params().ignore_deprecated_profiles)
if ((*d / "deprecated").is_regular_file_or_symlink_to_regular_file())
- Log::get_instance()->message(ll_warning, lc_context) << "Profile directory '" << *d
+ Log::get_instance()->message("e.profile.deprecated", ll_warning, lc_context) << "Profile directory '" << *d
<< "' is deprecated. See the file '" << (*d / "deprecated") << "' for details";
load_profile_directory_recursively(*d);
@@ -227,8 +227,8 @@ Implementation<ERepositoryProfile>::load_profile_directory_recursively(const FSE
if (! dir.is_directory_or_symlink_to_directory())
{
- Log::get_instance()->message(ll_warning, lc_context,
- "Profile component '" + stringify(dir) + "' is not a directory");
+ Log::get_instance()->message("e.profile.not_a_directory", ll_warning, lc_context)
+ << "Profile component '" << dir << "' is not a directory";
return;
}
@@ -262,14 +262,15 @@ Implementation<ERepositoryProfile>::load_profile_parent(const FSEntry & dir)
LineConfigFile::ConstIterator i(file.begin()), i_end(file.end());
bool once(false);
if (i == i_end)
- Log::get_instance()->message(ll_warning, lc_context, "parent file is empty");
+ Log::get_instance()->message("e.profile.parent.empty", ll_warning, lc_context) << "parent file is empty";
else
for ( ; i != i_end ; ++i)
{
if ('#' == i->at(0))
{
if (! once)
- Log::get_instance()->message(ll_qa, lc_context, "Comments not allowed in '" + stringify(dir / "parent") + "'");
+ Log::get_instance()->message("e.profile.parent.no_comments", ll_qa, lc_context)
+ << "Comments not allowed in '" << (dir / "parent") << "'";
once = true;
continue;
}
@@ -283,8 +284,8 @@ Implementation<ERepositoryProfile>::load_profile_parent(const FSEntry & dir)
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping parent '"
- + *i + "' due to exception: " + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.parent.skipping", ll_warning, lc_context)
+ << "Skipping parent '" << *i << "' due to exception: " << e.message() << " (" << e.what() << ")";
continue;
}
@@ -348,8 +349,8 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_var + "' failed due to exception: "
- + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.make_defaults.use_expand_failure", ll_warning, lc_context)
+ << "Loading '" << use_expand_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
}
}
@@ -371,8 +372,8 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_var + "' failed due to exception: "
- + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.make_defaults.use_failure", ll_warning, lc_context)
+ << "Loading '" << use_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
}
std::string use_expand_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
@@ -390,8 +391,8 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_var + "' failed due to exception: "
- + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.make_defaults.use_expand_failure", ll_warning, lc_context)
+ << "Loading '" << use_expand_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
}
std::string use_expand_hidden_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
@@ -409,8 +410,9 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_hidden_var + "' failed due to exception: "
- + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.make_defaults.use_expand_hidden_failure", ll_warning, lc_context)
+ << "Loading '" << use_expand_hidden_var << "' failed due to exception: "
+ << e.message() << " (" << e.what() << ")";
}
}
@@ -437,7 +439,8 @@ Implementation<ERepositoryProfile>::is_incremental(const std::string & s) const
}
catch (const Exception & x)
{
- Log::get_instance()->message(ll_qa, lc_context) << "Caught exception '" << x.message() << "' (" << x.what()
+ Log::get_instance()->message("e.profile.make_defaults.incremental_check_failure", ll_qa, lc_context)
+ << "Caught exception '" << x.message() << "' (" << x.what()
<< "), possibly due to weird variable name being used in profile";
return (! s.empty()) &&
@@ -476,8 +479,8 @@ Implementation<ERepositoryProfile>::make_vars_from_file_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading packages "
- " failed due to exception: " + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.packages.failure", ll_warning, lc_context) << "Loading packages "
+ " failed due to exception: " << e.message() << " (" << e.what() << ")";
}
if ((*DistributionData::get_instance()->distribution_from_string(
@@ -505,8 +508,8 @@ Implementation<ERepositoryProfile>::make_vars_from_file_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading virtuals "
- " failed due to exception: " + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.virtuals.failure", ll_warning, lc_context)
+ << "Loading virtuals failed due to exception: " << e.message() << " (" << e.what() << ")";
}
for (erepository::ProfileFile<erepository::MaskFile>::ConstIterator line(package_mask_file.begin()), line_end(package_mask_file.end()) ;
@@ -524,9 +527,9 @@ Implementation<ERepositoryProfile>::make_vars_from_file_vars()
if (a->package_ptr())
package_mask[*a->package_ptr()].push_back(std::make_pair(a, line->second));
else
- Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
- + stringify(line->first) + "' failed because specification does not restrict to a "
- "unique package");
+ Log::get_instance()->message("e.profile.package_mask.bad_spec", ll_warning, lc_context)
+ << "Loading package.mask spec '" << line->first << "' failed because specification does not restrict to a "
+ "unique package";
}
catch (const InternalError &)
{
@@ -534,9 +537,9 @@ Implementation<ERepositoryProfile>::make_vars_from_file_vars()
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
- + stringify(line->first) + "' failed due to exception '" + e.message() + "' ("
- + e.what() + ")");
+ Log::get_instance()->message("e.profile.package_mask.bad_spec", ll_warning, lc_context)
+ << "Loading package.mask spec '" << line->first << "' failed due to exception '" << e.message() << "' ("
+ << e.what() << ")";
}
}
}
@@ -573,8 +576,8 @@ Implementation<ERepositoryProfile>::load_basic_use_file(const FSEntry & file, Fl
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring token '"
- + *t + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.failure", ll_warning, lc_context) << "Ignoring token '"
+ << *t << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -622,15 +625,15 @@ Implementation<ERepositoryProfile>::load_spec_use_file(const FSEntry & file, Pac
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring token '"
- + *t + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.failure", ll_warning, lc_context) << "Ignoring token '"
+ << *t << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
catch (const PackageDepSpecError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring line '"
- + *line + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.profile.failure", ll_warning, lc_context) << "Ignoring line '"
+ << *line << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
diff --git a/paludis/repositories/e/e_repository_profile_file.cc b/paludis/repositories/e/e_repository_profile_file.cc
index b3399e0..1b0e5b6 100644
--- a/paludis/repositories/e/e_repository_profile_file.cc
+++ b/paludis/repositories/e/e_repository_profile_file.cc
@@ -114,8 +114,8 @@ ProfileFile<F_>::add_file(const FSEntry & f)
* section is inherited more than once. Don't warn when this
* happens. */
if (this->_imp->removed.end() == this->_imp->removed.find(key.substr(1)))
- Log::get_instance()->message(ll_qa, lc_context, "No match for '" + key + "'. This usually indicates a "
- "bug in your profile.");
+ Log::get_instance()->message("e.profile.no_match", ll_qa, lc_context)
+ << "No match for '" << key << "'. This usually indicates a bug in your profile.";
}
else
{
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index c876ff5..d92996c 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -151,9 +151,8 @@ ERepositorySets::sets_list() const
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping set '"
- + stringify(*f) + "' due to exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ")");
+ Log::get_instance()->message("e.sets.failure", ll_warning, lc_context) << "Skipping set '"
+ << *f << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
catch (const paludis::DirOpenError &)
@@ -303,8 +302,8 @@ ERepositorySets::security_set(bool insecurity) const
{
if (is_vulnerable(*glsa_pkg, **r))
{
- Log::get_instance()->message(ll_debug, lc_context, "Skipping '" + stringify(**r)
- + "' due to is_vulnerable match");
+ Log::get_instance()->message("e.glsa.skipping_vulnerable", ll_debug, lc_context)
+ << "Skipping '" << **r << "' due to is_vulnerable match";
continue;
}
@@ -329,13 +328,13 @@ ERepositorySets::security_set(bool insecurity) const
}
catch (const GLSAError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot use GLSA '" +
- stringify(*f) + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.glsa.failure", ll_warning, lc_context)
+ << "Cannot use GLSA '" << *f << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot use GLSA '" +
- stringify(*f) + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.glsa.failure", ll_warning, lc_context)
+ << "Cannot use GLSA '" << *f << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index be630fb..56672ba 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -321,16 +321,16 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Caught exception '" +
- stringify(e.message()) + "' (" + stringify(e.what()) +
- ") when generating cache for '" + stringify(*params[k::package_id()]) + "', input is '" + purdy(input) + "'");
+ Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Caught exception '"
+ << e.message() << "' (" << e.what() << ") when generating cache for '"
+ << *params[k::package_id()] << "', input is '" << purdy(input) << "'";
}
if (ok)
return true;
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "Could not generate cache for '"
+ Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Could not generate cache for '"
<< *params[k::package_id()] << "'";
keys.reset(new Map<std::string, std::string>);
keys->insert("EAPI", (*EAPIData::get_instance()->unknown_eapi())[k::name()]);
@@ -360,12 +360,14 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
if (! (*id->eapi())[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
+ Log::get_instance()->message("e.ebuild.preload_eapi.unsupported", ll_debug, lc_context)
+ << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
id->set_slot(SlotName("UNKNOWN"));
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
+ Log::get_instance()->message("e.ebuild.preload_eapi.supported", ll_debug, lc_context)
+ << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
std::string s;
if (! ((s = get(keys, (*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()].metadata_eapi))).empty())
@@ -375,12 +377,14 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
if (! (*id->eapi())[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
+ Log::get_instance()->message("e.ebuild.postload_eapi.unsupported", ll_debug, lc_context)
+ << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
id->set_slot(SlotName("UNKNOWN"));
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
+ Log::get_instance()->message("e.ebuild.postload_eapi.supported", ll_debug, lc_context)
+ << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
const EAPIEbuildMetadataVariables & m((*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()]);
@@ -416,7 +420,8 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
std::string slot(get(keys, m.metadata_slot));
if (slot.empty())
{
- Log::get_instance()->message(ll_qa, lc_context) << "Package '" << *id << "' set SLOT=\"\", using SLOT=\"0\" instead";
+ Log::get_instance()->message("e.ebuild.no_slot", ll_qa, lc_context)
+ << "Package '" << *id << "' set SLOT=\"\", using SLOT=\"0\" instead";
slot = "0";
}
id->set_slot(SlotName(slot));
@@ -427,7 +432,8 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Setting SLOT for '" << *id << "' failed due to exception '"
+ Log::get_instance()->message("e.ebuild.bad_slot", ll_warning, lc_context)
+ << "Setting SLOT for '" << *id << "' failed due to exception '"
<< e.message() << "' (" << e.what() << ")";
id->set_slot(SlotName("0"));
}
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 792c3b5..79f62a3 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -92,8 +92,8 @@ namespace
std::string result(file.get("manifest_key_" + s));
if (result.empty())
{
- Log::get_instance()->message(ll_warning, lc_context) << "Don't know what the manifest key for files with "
- "suffix '" << s << "' is, guessing 'MISC'";
+ Log::get_instance()->message("e.ebuild.unknown_manifest_key", ll_warning, lc_context)
+ << "Don't know what the manifest key for files with suffix '" << s << "' is, guessing 'MISC'";
return "MISC";
}
else
@@ -311,18 +311,15 @@ namespace
{
if (f.group() != env->reduced_gid())
{
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' owned by group '" +
- stringify(get_group_name(f.group())) + "', not '" +
- stringify(get_group_name(env->reduced_gid())) +
- "', so cannot enable userpriv");
+ Log::get_instance()->message("e.ebuild.userpriv_disabled", ll_warning, lc_context) << "Directory '" <<
+ f << "' owned by group '" << get_group_name(f.group()) << "', not '"
+ << get_group_name(env->reduced_gid()) << "', so cannot enable userpriv";
return false;
}
else if (! f.has_permission(fs_ug_group, fs_perm_write))
{
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' does not have group write permission," +
- "cannot enable userpriv");
+ Log::get_instance()->message("e.ebuild.userpriv_disabled", ll_warning, lc_context) << "Directory '" <<
+ f << "' does not have group write permission, cannot enable userpriv";
return false;
}
}
@@ -623,7 +620,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
libdir = "lib";
}
- Log::get_instance()->message(ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
+ Log::get_instance()->message("e.ebuild.libdir", ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
EStripper stripper(EStripperOptions::named_create()
(k::package_id(), id)
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index a966ef8..44fb060 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -165,13 +165,13 @@ EbuildFlatMetadataCache::load(const tr1::shared_ptr<const EbuildID> & id)
id->set_slot(SlotName("UNKNOWN"));
if (! ok)
- Log::get_instance()->message(ll_warning, lc_no_context) << "Stale cache file at '"
+ Log::get_instance()->message("e.cache.stale", ll_warning, lc_no_context) << "Stale cache file at '"
<< _filename << "'";
return ok;
}
else
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Incomplete cache file at '"
+ Log::get_instance()->message("e.cache.incomplete", ll_warning, lc_no_context) << "Incomplete cache file at '"
<< _filename << "'";
return false;
}
@@ -182,15 +182,15 @@ EbuildFlatMetadataCache::load(const tr1::shared_ptr<const EbuildID> & id)
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Not using cache file at '"
+ Log::get_instance()->message("e.cache.failure", ll_warning, lc_no_context) << "Not using cache file at '"
<< _filename << "' due to exception '" << e.message() << "' (" << e.what() << ")";
return false;
}
}
else
{
- Log::get_instance()->message(_silent ? ll_debug : ll_warning, lc_no_context,
- "Couldn't use the cache file at '" + stringify(_filename) + "'");
+ Log::get_instance()->message("e.cache.failure", _silent ? ll_debug : ll_warning, lc_no_context)
+ << "Couldn't use the cache file at '" << _filename << "'";
return false;
}
}
@@ -227,13 +227,13 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Couldn't create cache directory: " << e.message();
+ Log::get_instance()->message("e.cache.save.failure", ll_warning, lc_no_context) << "Couldn't create cache directory: " << e.message();
return;
}
if (! (*id->eapi())[k::supported()])
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Not writing cache file to '"
+ Log::get_instance()->message("e.cache.save.eapi_unsupoprted", ll_warning, lc_no_context) << "Not writing cache file to '"
<< _filename << "' because EAPI '" << (*id->eapi())[k::name()] << "' is not supported";
return;
}
@@ -374,7 +374,7 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Not writing cache file to '"
+ Log::get_instance()->message("e.cache.save.failure", ll_warning, lc_no_context) << "Not writing cache file to '"
<< _filename << "' due to exception '" << e.message() << "' (" << e.what() << ")";
return;
}
@@ -385,7 +385,7 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
cache_file << cache.str();
else
{
- Log::get_instance()->message(ll_warning, lc_no_context) << "Couldn't write cache file to '"
+ Log::get_instance()->message("e.cache.save.failure", ll_warning, lc_no_context) << "Couldn't write cache file to '"
<< _filename << "': " << std::strerror(errno);
}
}
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 0aa1aec..a74ce3e 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -195,7 +195,8 @@ EbuildID::need_keys_added() const
if (! ok)
{
if (_imp->repository->params().cache.basename() != "empty")
- Log::get_instance()->message(ll_qa, lc_no_context) << "No usable cache entry for '" + canonical_form(idcf_full);
+ Log::get_instance()->message("e.ebuild.cache.no_usable", ll_qa, lc_no_context)
+ << "No usable cache entry for '" + canonical_form(idcf_full);
std::string eapi_str(_imp->guessed_eapi);
if (eapi_str.empty())
@@ -204,7 +205,7 @@ EbuildID::need_keys_added() const
if ((*_imp->eapi)[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "Generating metadata command for '"
+ Log::get_instance()->message("e.ebuild.metadata.using_eapi", ll_debug, lc_context) << "Generating metadata command for '"
<< canonical_form(idcf_full) << "' using EAPI '" << (*_imp->eapi)[k::name()] << "'";
EAPIPhases phases((*(*_imp->eapi)[k::supported()])[k::ebuild_phases()].ebuild_metadata);
@@ -231,12 +232,12 @@ EbuildID::need_keys_added() const
(k::userpriv(), phases.begin_phases()->option("userpriv")));
if (! cmd())
- Log::get_instance()->message(ll_warning, lc_no_context) << "No usable metadata for '" +
+ Log::get_instance()->message("e.ebuild.metadata.unusable", ll_warning, lc_no_context) << "No usable metadata for '" +
stringify(canonical_form(idcf_full)) << "'";
cmd.load(shared_from_this());
- Log::get_instance()->message(ll_debug, lc_context) << "Generated metadata for '"
+ Log::get_instance()->message("e.ebuild.metadata.generated_eapi", ll_debug, lc_context) << "Generated metadata for '"
<< canonical_form(idcf_full) << "' has EAPI '" << (*_imp->eapi)[k::name()] << "'";
if (_imp->repository->params().write_cache.basename() != "empty" && (*_imp->eapi)[k::supported()])
@@ -248,7 +249,7 @@ EbuildID::need_keys_added() const
}
else
{
- Log::get_instance()->message(ll_debug, lc_context) << "Can't run metadata command for '"
+ Log::get_instance()->message("e.ebuild.metadata.unknown_eapi", ll_debug, lc_context) << "Can't run metadata command for '"
<< canonical_form(idcf_full) << "' because EAPI '" << (*_imp->eapi)[k::name()] << "' is unknown";
}
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index d846391..0b120c5 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -136,7 +136,7 @@ ExheresLayout::need_category_names() const
Context context("When loading category names for " + stringify(_imp->repository->name()) + ":");
- Log::get_instance()->message(ll_debug, lc_context, "need_category_names");
+ Log::get_instance()->message("e.exheres_layout.need_category_names", ll_debug, lc_context) << "need_category_names";
bool found_one(false);
@@ -162,9 +162,9 @@ ExheresLayout::need_category_names() const
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping line '"
- + *line + "' in '" + stringify(*i) + "' due to exception '"
- + stringify(e.message()) + "' ('" + e.what() + ")");
+ Log::get_instance()->message("e.exheres_layout.categories.skipping", ll_warning, lc_context)
+ << "Skipping line '" << *line << "' in '" << *i << "' due to exception '"
+ << e.message() << "' ('" << e.what() << ")";
}
}
@@ -205,9 +205,9 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, *e));
if (indirect_iterator(v->end()) != std::find_if(indirect_iterator(v->begin()), indirect_iterator(v->end()),
tr1::bind(std::equal_to<VersionSpec>(), id->version(), tr1::bind(tr1::mem_fn(&PackageID::version), _1))))
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring entry '" + stringify(*e)
- + "' for '" + stringify(n) + "' in repository '" + stringify(_imp->repository->name())
- + "' because another equivalent version already exists");
+ Log::get_instance()->message("e.exheres_layout.id.duplicate", ll_warning, lc_context)
+ << "Ignoring entry '" << *e << "' for '" << n << "' in repository '" << _imp->repository->name()
+ << "' because another equivalent version already exists";
else
v->push_back(id);
}
@@ -217,10 +217,10 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
}
catch (const Exception & ee)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping entry '"
- + stringify(*e) + "' for '" + stringify(n) + "' in repository '"
- + stringify(_imp->repository->name()) + "' due to exception '" + ee.message() + "' ("
- + ee.what() + ")'");
+ Log::get_instance()->message("e.exheres_layout.id.failure", ll_warning, lc_context) << "Skipping entry '"
+ << *e << "' for '" << n << "' in repository '"
+ << _imp->repository->name() << "' due to exception '" << ee.message() << "' ("
+ << ee.what() << ")'";
}
}
@@ -338,9 +338,9 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping entry '" +
- d->basename() + "' in category '" + stringify(c) + "' in repository '"
- + stringify(_imp->repository->name()) + "' (" + e.message() + ")");
+ Log::get_instance()->message("e.exheres_layout.packages.failure", ll_warning, lc_context)
+ << "Skipping entry '" << d->basename() << "' in category '" << c << "' in repository '"
+ << _imp->repository->name() << "' (" << e.message() << ")";
}
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index a81e8e2..6107a22 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -152,7 +152,8 @@ ExndbamRepository::make_exndbam_repository(
builddir = (*DistributionData::get_instance()->distribution_from_string(
env->default_distribution()))[k::default_ebuild_builddir()];
else
- Log::get_instance()->message(ll_warning, lc_context) << "Key 'buildroot' is deprecated, use 'builddir' instead";
+ Log::get_instance()->message("e.exndbam.configuration.deprecated", ll_warning, lc_context)
+ << "Key 'buildroot' is deprecated, use 'builddir' instead";
}
std::string name;
@@ -163,7 +164,7 @@ ExndbamRepository::make_exndbam_repository(
if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty())
deprecated_world = "/DOESNOTEXIST";
else
- Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " <<
+ Log::get_instance()->message("e.exndbam.configuration.deprecated", ll_warning, lc_context) << "Specifying world location " <<
"in repository configuration files is deprecated. File '" << deprecated_world << "' will be "
"read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
"the FAQ Upgrades section.";
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 7b06a30..f3ea9c0 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -176,7 +176,8 @@ FetchVisitor::visit_leaf(const FetchableURIDepSpec & u)
std::string protocol(i->first.substr(0, protocol_pos));
if (protocol.empty())
{
- Log::get_instance()->message(ll_warning, lc_context) << "URI part '" << i->first << "' has empty protocol";
+ Log::get_instance()->message("e.fetch_visitor.no_protocol", ll_warning, lc_context)
+ << "URI part '" << i->first << "' has empty protocol";
continue;
}
@@ -238,7 +239,8 @@ FetchVisitor::visit_leaf(const FetchableURIDepSpec & u)
}
if (! found)
- Log::get_instance()->message(ll_warning, lc_context) << "URI part '" << i->first << "' uses unknown protocol '"
+ Log::get_instance()->message("e.fetch_visitor.unknown_protocol", ll_warning, lc_context)
+ << "URI part '" << i->first << "' uses unknown protocol '"
<< protocol << "'";
}
}
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index 66ec1a0..97229f9 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -200,9 +200,9 @@ paludis::make_ebuild_repository(
env->default_distribution()))[k::default_ebuild_names_cache()];
if (names_cache.empty())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "The names_cache key is not set in '"
- + repo_file + "'. You should read the Paludis documentation and select an "
- "appropriate value.");
+ Log::get_instance()->message("e.ebuild.configuration.no_names_cache", ll_warning, lc_no_context)
+ << "The names_cache key is not set in '" << repo_file
+ << "'. You should read the Paludis documentation and select an appropriate value.";
names_cache = "/var/empty";
}
}
@@ -217,8 +217,8 @@ paludis::make_ebuild_repository(
if (m->end() != m->find("sync_exclude"))
{
- Log::get_instance()->message(ll_warning, lc_no_context, "The sync_exclude key in '"
- + repo_file + "' is deprecated in favour of sync_options = --exclude-from=");
+ Log::get_instance()->message("e.ebuild.configuration.deprecated", ll_warning, lc_no_context)
+ << "The sync_exclude key in '" << repo_file << "' is deprecated in favour of sync_options = --exclude-from=";
if (! sync_options.empty())
sync_options += " ";
sync_options += "--exclude-from='" + m->find("sync_exclude")->second + "'";
@@ -231,7 +231,8 @@ paludis::make_ebuild_repository(
builddir = (*DistributionData::get_instance()->distribution_from_string(
env->default_distribution()))[k::default_ebuild_builddir()];
else
- Log::get_instance()->message(ll_warning, lc_context) << "Key 'buildroot' is deprecated, use 'builddir' instead";
+ Log::get_instance()->message("e.ebuild.configuration.deprecated", ll_warning, lc_context)
+ << "Key 'buildroot' is deprecated, use 'builddir' instead";
}
std::string layout;
diff --git a/paludis/repositories/e/manifest2_reader.cc b/paludis/repositories/e/manifest2_reader.cc
index 9446a78..080f458 100644
--- a/paludis/repositories/e/manifest2_reader.cc
+++ b/paludis/repositories/e/manifest2_reader.cc
@@ -118,7 +118,7 @@ Manifest2Reader::Manifest2Reader(const FSEntry & f) :
else if ("MD5" == checksum_type)
md5 = (*t);
else
- Log::get_instance()->message(ll_debug, lc_no_context)
+ Log::get_instance()->message("e.manifest.unknown_checksum", ll_debug, lc_no_context)
<< "Skipping unknown checksum type " << checksum_type;
}
diff --git a/paludis/repositories/e/package_dep_spec.cc b/paludis/repositories/e/package_dep_spec.cc
index 4a27a12..8703caa 100644
--- a/paludis/repositories/e/package_dep_spec.cc
+++ b/paludis/repositories/e/package_dep_spec.cc
@@ -57,7 +57,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("[] dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "[] dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.brackets_not_allowed", ll_warning, lc_context)
+ << "[] dependencies not safe for use with this EAPI";
}
if (s.at(s.length() - 1) != ']')
@@ -222,7 +223,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Repository dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "Repository dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.repository_not_allowed", ll_warning, lc_context)
+ << "Repository dependencies not safe for use with this EAPI";
}
result.repository(RepositoryName(s.substr(repo_p + 2)));
@@ -243,7 +245,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Slot '*' dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "Slot '*' dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.slot_star_not_allowed", ll_warning, lc_context)
+ << "Slot '*' dependencies not safe for use with this EAPI";
}
result.slot_requirement(make_shared_ptr(new ESlotAnyUnlockedRequirement));
}
@@ -254,7 +257,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Slot '=' dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "Slot '=' dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.slot_equals_not_allowed", ll_warning, lc_context)
+ << "Slot '=' dependencies not safe for use with this EAPI";
}
if (1 == match.length())
@@ -269,7 +273,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Slot dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "Slot dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.slot_not_allowed", ll_warning, lc_context)
+ << "Slot dependencies not safe for use with this EAPI";
}
result.slot_requirement(make_shared_ptr(new ESlotExactRequirement(SlotName(s.substr(slot_p + 1)), false)));
}
@@ -292,7 +297,8 @@ paludis::erepository::partial_parse_e_package_dep_spec(
if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("~> dependencies not safe for use with this EAPI");
else
- Log::get_instance()->message(ll_warning, lc_context, "~> dependencies not safe for use with this EAPI");
+ Log::get_instance()->message("e.package_dep_spec.tilde_greater_not_allowed", ll_warning, lc_context)
+ << "~> dependencies not safe for use with this EAPI";
}
std::string::size_type q(p);
@@ -350,10 +356,9 @@ paludis::erepository::partial_parse_e_package_dep_spec(
"Package dep spec '" + ss + "' uses * "
"with operator '" + stringify(op) + "'");
else
- Log::get_instance()->message(ll_qa, lc_context,
- "Package dep spec '" + ss + "' uses * "
- "with operator '" + stringify(op) +
- "', pretending it uses the equals operator instead");
+ Log::get_instance()->message("e.package_dep_spec.bad_operator", ll_qa, lc_context)
+ << "Package dep spec '" << ss << "' uses * with operator '" << op <<
+ "', pretending it uses the equals operator instead";
}
}
op = vo_equal_star;
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 1445c68..3c4b7fa 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -63,7 +63,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
tokenise_whitespace(s, std::back_inserter(tokens));
if (tokens.empty())
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got empty pipe command";
+ Log::get_instance()->message("e.pipe_commands.empty", ll_warning, lc_context) << "Got empty pipe command";
return "Eempty pipe command";
}
@@ -71,7 +71,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad PING command";
+ Log::get_instance()->message("e.pipe_commands.ping.bad", ll_warning, lc_context) << "Got bad PING command";
return "Ebad PING command";
}
else
@@ -81,13 +81,13 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() < 4)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got too short LOG pipe command";
+ Log::get_instance()->message("e.pipe_commands.log.bad", ll_warning, lc_context) << "Got too short LOG pipe command";
return "Ebad LOG command";
}
else
{
- Log::get_instance()->message(destringify<LogLevel>(tokens[2]), lc_context) << join(next(next(next(tokens.begin()))),
- tokens.end(), " ");
+ Log::get_instance()->message("e.child.message", destringify<LogLevel>(tokens[2]), lc_context)
+ << join(next(next(next(tokens.begin()))), tokens.end(), " ");
return "O";
}
}
@@ -95,7 +95,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad BEST_VERSION pipe command";
+ Log::get_instance()->message("e.pipe_commands.best_version.bad", ll_warning, lc_context) << "Got bad BEST_VERSION pipe command";
return "Ebad BEST_VERSION command";
}
else
@@ -110,7 +110,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
if ((*(*eapi)[k::supported()])[k::pipe_commands()][k::rewrite_virtuals()] && (! entries->empty()) &&
(*entries->last())->virtual_for_key())
{
- Log::get_instance()->message(ll_qa, lc_context) << "best-version of '" << spec <<
+ Log::get_instance()->message("e.pipe_commands.best_version.is_virtual", ll_qa, lc_context) << "best-version of '" << spec <<
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
@@ -134,7 +134,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad HAS_VERSION pipe command";
+ Log::get_instance()->message("e.pipe_commands.has_version.bad", ll_warning, lc_context) << "Got bad HAS_VERSION pipe command";
return "Ebad HAS_VERSION command";
}
else
@@ -156,7 +156,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad MATCH pipe command";
+ Log::get_instance()->message("e.pipe_commands.match.bad", ll_warning, lc_context) << "Got bad MATCH pipe command";
return "Ebad MATCH command";
}
else
@@ -176,7 +176,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if ((*i)->virtual_for_key())
{
- Log::get_instance()->message(ll_qa, lc_context) << "match of '" << spec <<
+ Log::get_instance()->message("e.pipe_commands.match.is_virtual", ll_qa, lc_context) << "match of '" << spec <<
"' resolves to '" << **i << "', which is a virtual for '"
<< *(*i)->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
@@ -203,7 +203,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 2)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad VDB_PATH pipe command";
+ Log::get_instance()->message("e.pipe_commands.vdb_path.bad", ll_warning, lc_context) << "Got bad VDB_PATH pipe command";
return "Ebad VDB_PATH command";
}
else
@@ -223,7 +223,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() < 4)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad REWRITE_VAR pipe command";
+ Log::get_instance()->message("e.pipe_commands.rewrite_var.bad", ll_warning, lc_context) << "Got bad REWRITE_VAR pipe command";
return "Ebad REWRITE_VAR command";
}
@@ -254,7 +254,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() < 3)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad EVER pipe command";
+ Log::get_instance()->message("e.pipe_commands.ever.bad", ll_warning, lc_context) << "Got bad EVER pipe command";
return "Ebad EVER command";
}
@@ -262,7 +262,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
if (tokens.size() != 5)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got bad EVER AT_LEAST pipe command";
+ Log::get_instance()->message("e.pipe_commands.ever.at_least.bad", ll_warning, lc_context) << "Got bad EVER AT_LEAST pipe command";
return "Ebad EVER AT_LEAST command {'" + join(tokens.begin(), tokens.end(), "', '") + "'}";
}
@@ -271,13 +271,13 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
}
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got unknown EVER pipe subcommand";
+ Log::get_instance()->message("e.pipe_commands.ever.unknown", ll_warning, lc_context) << "Got unknown EVER pipe subcommand";
return "Ebad EVER subcommand";
}
}
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got unknown ebuild pipe command '" + s + "'";
+ Log::get_instance()->message("e.pipe_commands.unknown", ll_warning, lc_context) << "Got unknown ebuild pipe command '" + s + "'";
return "Eunknown pipe command";
}
}
diff --git a/paludis/repositories/e/qa/categories.cc b/paludis/repositories/e/qa/categories.cc
index 0f5f6ac..86c40d0 100644
--- a/paludis/repositories/e/qa/categories.cc
+++ b/paludis/repositories/e/qa/categories.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -39,7 +39,7 @@ paludis::erepository::categories_check(
{
Context context("When performing check '" + name + "':");
FSEntry cats(repo->layout()->categories_file());
- Log::get_instance()->message(ll_debug, lc_context) << "categories_check '"
+ Log::get_instance()->message("e.qa.categories_check", ll_debug, lc_context) << "categories_check '"
<< cats << "', " << name << "'";
try
diff --git a/paludis/repositories/e/qa/changelog.cc b/paludis/repositories/e/qa/changelog.cc
index 77f3272..90e2b3b 100644
--- a/paludis/repositories/e/qa/changelog.cc
+++ b/paludis/repositories/e/qa/changelog.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -35,7 +35,7 @@ paludis::erepository::changelog_check(
)
{
Context context("When performing check '" + name + "' using changelog_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "changelog_check '"
+ Log::get_instance()->message("e.qa.changelog_check", ll_debug, lc_context) << "changelog_check '"
<< dir << "', " << name << "'";
FSEntry f(dir / "ChangeLog");
diff --git a/paludis/repositories/e/qa/default_functions.cc b/paludis/repositories/e/qa/default_functions.cc
index 33bb5a3..c8cbbeb 100644
--- a/paludis/repositories/e/qa/default_functions.cc
+++ b/paludis/repositories/e/qa/default_functions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -54,7 +54,7 @@ paludis::erepository::default_functions_check(
pcrepp::Pcre::Pcre r_unpack("^\\s*unpack *([$]A|[$][{]A[}]|\"[$][{]A[}]\"|[$][{]A[}])( *\\|\\| *die.*)?$");
pcrepp::Pcre::Pcre r_cd_s("^\\s*cd *([$]S|[$][{]S[}]|\"[$][{]S[}]\"|[$][{]S[}])( *\\|\\| *die.*)?$");
- Log::get_instance()->message(ll_debug, lc_context) << "default_functions '"
+ Log::get_instance()->message("e.qa.default_functions_check", ll_debug, lc_context) << "default_functions '"
<< entry << "', '" << *id << "', '" << name << "'";
std::istringstream ff(content);
diff --git a/paludis/repositories/e/qa/deprecated_functions.cc b/paludis/repositories/e/qa/deprecated_functions.cc
index 19e20d3..5e124c8 100644
--- a/paludis/repositories/e/qa/deprecated_functions.cc
+++ b/paludis/repositories/e/qa/deprecated_functions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -61,7 +61,8 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got error '" << e.message() << "' (" << e.what()
+ Log::get_instance()->message("e.qa.deprecated_functions_check.configuration_error", ll_warning, lc_context)
+ << "Got error '" << e.message() << "' (" << e.what()
<< ") when loading deprecated_functions.conf for QA deprecated_functions";
}
}
@@ -93,10 +94,10 @@ paludis::erepository::deprecated_functions_check(
deprecated_functions.push_back(std::make_pair(*it, pcrepp::Pcre::Pcre(*it)));
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "deprecated_functions '"
+ Log::get_instance()->message("e.qa.deprecated_functions_check", ll_debug, lc_context) << "deprecated_functions '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "deprecated_functions '"
+ Log::get_instance()->message("e.qa.deprecated_functions_check", ll_debug, lc_context) << "deprecated_functions '"
<< entry << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/ebuild_count.cc b/paludis/repositories/e/qa/ebuild_count.cc
index 407abc5..5128544 100644
--- a/paludis/repositories/e/qa/ebuild_count.cc
+++ b/paludis/repositories/e/qa/ebuild_count.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -36,7 +36,7 @@ paludis::erepository::ebuild_count_check(
)
{
Context context("When performing check '" + name + "' using ebuild_count_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "ebuild_count_check '"
+ Log::get_instance()->message("e.qa.ebuild_count_check", ll_debug, lc_context) << "ebuild_count_check '"
<< dir << "', " << name << "'";
tr1::shared_ptr<const PackageIDSequence> ids(repo->package_ids(q));
diff --git a/paludis/repositories/e/qa/extractors.cc b/paludis/repositories/e/qa/extractors.cc
index c8110b6..8ad0eb5 100644
--- a/paludis/repositories/e/qa/extractors.cc
+++ b/paludis/repositories/e/qa/extractors.cc
@@ -60,7 +60,8 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got error '" << e.message() << "' (" << e.what()
+ Log::get_instance()->message("e.metadata_key.extractors.configuration_error", ll_warning, lc_context)
+ << "Got error '" << e.message() << "' (" << e.what()
<< ") when loading extractors.conf for QA extractors_check";
file.reset(new KeyValueConfigFile(std::string(), KeyValueConfigFileOptions()));
}
@@ -256,7 +257,7 @@ paludis::erepository::extractors_check(
const std::string & name)
{
Context context("When performing check '" + name + "' on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "extractors_check '"
+ Log::get_instance()->message("e.qa.extractors_check", ll_debug, lc_context) << "extractors_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->fetches_key())
diff --git a/paludis/repositories/e/qa/fetches_key.cc b/paludis/repositories/e/qa/fetches_key.cc
index aab6c6e..461be73 100644
--- a/paludis/repositories/e/qa/fetches_key.cc
+++ b/paludis/repositories/e/qa/fetches_key.cc
@@ -191,7 +191,7 @@ paludis::erepository::fetches_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using fetches_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "fetches_key_check '"
+ Log::get_instance()->message("e.qa.fetches_key_check", ll_debug, lc_context) << "fetches_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->fetches_key())
diff --git a/paludis/repositories/e/qa/files_dir_size.cc b/paludis/repositories/e/qa/files_dir_size.cc
index d5b44ff..025ad24 100644
--- a/paludis/repositories/e/qa/files_dir_size.cc
+++ b/paludis/repositories/e/qa/files_dir_size.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -36,7 +36,7 @@ paludis::erepository::files_dir_size_check(
)
{
Context context("When performing check '" + name + "' using files_dir_size_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "files_dir_size_check '"
+ Log::get_instance()->message("e.qa.files_dir_size_check", ll_debug, lc_context) << "files_dir_size_check '"
<< dir << "', " << name << "'";
struct SizeFinder
diff --git a/paludis/repositories/e/qa/function_keyword.cc b/paludis/repositories/e/qa/function_keyword.cc
index 7f25746..d3cee31 100644
--- a/paludis/repositories/e/qa/function_keyword.cc
+++ b/paludis/repositories/e/qa/function_keyword.cc
@@ -48,10 +48,10 @@ paludis::erepository::function_keyword_check(
pcrepp::Pcre::Pcre r_function("^function +[^ ]+ *(\\(\\))? *{?");
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "function_keyword '"
+ Log::get_instance()->message("e.qa.function_keyword_check", ll_debug, lc_context) << "function_keyword '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "function_keyword '"
+ Log::get_instance()->message("e.qa.function_keyword_check", ll_debug, lc_context) << "function_keyword '"
<< entry << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/header.cc b/paludis/repositories/e/qa/header.cc
index 79e0240..70fdc3d 100644
--- a/paludis/repositories/e/qa/header.cc
+++ b/paludis/repositories/e/qa/header.cc
@@ -47,10 +47,10 @@ paludis::erepository::header_check(
Context context("When performing check '" + name + "' using default_functions on '" + (id ? stringify(*id) : stringify(entry)) + "':");
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "header '"
+ Log::get_instance()->message("e.qa.header_check", ll_debug, lc_context) << "header '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "header '"
+ Log::get_instance()->message("e.qa.header_check", ll_debug, lc_context) << "header '"
<< entry << "', '" << name << "'";
pcrepp::Pcre::Pcre r_licence("^# Distributed under the terms of the GNU General Public License v2$");
@@ -90,7 +90,7 @@ paludis::erepository::header_check(
break;
}
- Log::get_instance()->message(ll_debug, lc_context, "Expected copyright year is " + year);
+ Log::get_instance()->message("e.qa.header_check.year", ll_debug, lc_context) << "Expected copyright year is " << year;
pcrepp::Pcre::Pcre r_copyright("^# Copyright ((1999|200\\d)-)?" + year + " Gentoo Foundation$");
if (! r_copyright.search(lines[0]))
diff --git a/paludis/repositories/e/qa/homepage_key.cc b/paludis/repositories/e/qa/homepage_key.cc
index 0f7152b..a1753d3 100644
--- a/paludis/repositories/e/qa/homepage_key.cc
+++ b/paludis/repositories/e/qa/homepage_key.cc
@@ -94,7 +94,7 @@ paludis::erepository::homepage_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using homepage_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "homepage_key_check '"
+ Log::get_instance()->message("e.qa.homepage_key_check", ll_debug, lc_context) << "homepage_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (! id->homepage_key())
diff --git a/paludis/repositories/e/qa/inherited_key.cc b/paludis/repositories/e/qa/inherited_key.cc
index 1922918..1f0657b 100644
--- a/paludis/repositories/e/qa/inherited_key.cc
+++ b/paludis/repositories/e/qa/inherited_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -59,7 +59,8 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got error '" << e.message() << "' (" << e.what()
+ Log::get_instance()->message("e.qa.inherited_key_check.configuration_error", ll_warning, lc_context)
+ << "Got error '" << e.message() << "' (" << e.what()
<< ") when loading inherited_blacklist.conf for QA inherited_key";
}
}
@@ -74,7 +75,7 @@ paludis::erepository::inherited_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using inherited_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "inherited_key_check '"
+ Log::get_instance()->message("e.qa.inherited_key_check", ll_debug, lc_context) << "inherited_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->inherited_key())
diff --git a/paludis/repositories/e/qa/iuse_key.cc b/paludis/repositories/e/qa/iuse_key.cc
index eeedaf3..ca15537 100644
--- a/paludis/repositories/e/qa/iuse_key.cc
+++ b/paludis/repositories/e/qa/iuse_key.cc
@@ -59,7 +59,8 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Got error '" << e.message() << "' (" << e.what()
+ Log::get_instance()->message("e.qa.iuse_key_check.configuration_error", ll_warning, lc_context)
+ << "Got error '" << e.message() << "' (" << e.what()
<< ") when loading iuse_blacklist.conf for QA iuse_key";
}
}
@@ -75,7 +76,7 @@ paludis::erepository::iuse_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using iuse_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "iuse_key_check '"
+ Log::get_instance()->message("e.qa.iuse_key_check", ll_debug, lc_context) << "iuse_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->iuse_key())
diff --git a/paludis/repositories/e/qa/keywords_key.cc b/paludis/repositories/e/qa/keywords_key.cc
index 54e53a4..cb4afce 100644
--- a/paludis/repositories/e/qa/keywords_key.cc
+++ b/paludis/repositories/e/qa/keywords_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -40,7 +40,7 @@ paludis::erepository::keywords_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using keywords_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "keywords_key_check '"
+ Log::get_instance()->message("e.qa.keywords_key_check", ll_debug, lc_context) << "keywords_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->keywords_key())
diff --git a/paludis/repositories/e/qa/kv_variables.cc b/paludis/repositories/e/qa/kv_variables.cc
index f222bcd..fb2b298 100644
--- a/paludis/repositories/e/qa/kv_variables.cc
+++ b/paludis/repositories/e/qa/kv_variables.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
@@ -40,7 +40,7 @@ paludis::erepository::kv_variables_check(
pcrepp::Pcre::Pcre r_global("^[a-zA-Z0-9\\_]+=.*\\$[{}]?KV");
pcrepp::Pcre::Pcre r_detect_version("^detect_version$");
- Log::get_instance()->message(ll_debug, lc_context) << "kv_variables '"
+ Log::get_instance()->message("e.qa.kv_variables_check", ll_debug, lc_context) << "kv_variables '"
<< entry << "', '" << *id << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/license_key.cc b/paludis/repositories/e/qa/license_key.cc
index e7d1bc1..b72833b 100644
--- a/paludis/repositories/e/qa/license_key.cc
+++ b/paludis/repositories/e/qa/license_key.cc
@@ -85,7 +85,7 @@ paludis::erepository::license_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using license_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "license_key_check '"
+ Log::get_instance()->message("e.qa.license_key_check", ll_debug, lc_context) << "license_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->license_key())
diff --git a/paludis/repositories/e/qa/manifest.cc b/paludis/repositories/e/qa/manifest.cc
index 416ceb5..96e46bb 100644
--- a/paludis/repositories/e/qa/manifest.cc
+++ b/paludis/repositories/e/qa/manifest.cc
@@ -226,7 +226,7 @@ paludis::erepository::manifest_check(
using namespace tr1::placeholders;
Context context("When performing check '" + name + "' using manifest_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "manifest_check '"
+ Log::get_instance()->message("e.qa.manifest_check", ll_debug, lc_context) << "manifest_check '"
<< dir << "', " << name << "'";
try
diff --git a/paludis/repositories/e/qa/metadata_keys.cc b/paludis/repositories/e/qa/metadata_keys.cc
index 13b43ce..86072ad 100644
--- a/paludis/repositories/e/qa/metadata_keys.cc
+++ b/paludis/repositories/e/qa/metadata_keys.cc
@@ -152,7 +152,7 @@ paludis::erepository::metadata_keys_check(
const std::string & name)
{
Context context("When performing check '" + name + "' on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "extractors_check '"
+ Log::get_instance()->message("e.qa.metadata_keys_check", ll_debug, lc_context) << "extractors_check '"
<< entry << "', " << *id << "', " << name << "'";
bool retval(true);
diff --git a/paludis/repositories/e/qa/misc_files.cc b/paludis/repositories/e/qa/misc_files.cc
index b2c91e1..e167836 100644
--- a/paludis/repositories/e/qa/misc_files.cc
+++ b/paludis/repositories/e/qa/misc_files.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -34,7 +34,7 @@ paludis::erepository::misc_files_check(
)
{
Context context("When performing check '" + name + "' using misc_files_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "misc_files_check '"
+ Log::get_instance()->message("e.qa.misc_files_check", ll_debug, lc_context) << "misc_files_check '"
<< dir << "', " << name << "'";
if (! (dir / "metadata.xml").is_regular_file())
diff --git a/paludis/repositories/e/qa/restrict_key.cc b/paludis/repositories/e/qa/restrict_key.cc
index 02e8bb5..13cd6f2 100644
--- a/paludis/repositories/e/qa/restrict_key.cc
+++ b/paludis/repositories/e/qa/restrict_key.cc
@@ -109,7 +109,7 @@ paludis::erepository::restrict_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using restrict_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "restrict_key_check '"
+ Log::get_instance()->message("e.qa.restrict_key_check", ll_debug, lc_context) << "restrict_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (id->restrict_key())
diff --git a/paludis/repositories/e/qa/root_variable.cc b/paludis/repositories/e/qa/root_variable.cc
index 463ef38..6d3751a 100644
--- a/paludis/repositories/e/qa/root_variable.cc
+++ b/paludis/repositories/e/qa/root_variable.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
@@ -50,7 +50,7 @@ paludis::erepository::root_variable_check(
pcrepp::Pcre::Pcre r_start("^src_");
pcrepp::Pcre::Pcre r_end("^}");
- Log::get_instance()->message(ll_debug, lc_context) << "root_variable '"
+ Log::get_instance()->message("e.qa.root_variable_check", ll_debug, lc_context) << "root_variable '"
<< entry << "', '" << *id << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/short_description_key.cc b/paludis/repositories/e/qa/short_description_key.cc
index 85fa3ee..3b9f49a 100644
--- a/paludis/repositories/e/qa/short_description_key.cc
+++ b/paludis/repositories/e/qa/short_description_key.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
@@ -32,7 +32,7 @@ paludis::erepository::short_description_key_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using short_description_key_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "short_description_key_check '"
+ Log::get_instance()->message("e.qa.short_description_key_check", ll_debug, lc_context) << "short_description_key_check '"
<< entry << "', " << *id << "', " << name << "'";
if (! id->short_description_key())
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index ae18cf8..1a32bdb 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -75,7 +75,8 @@ namespace
std::copy(ff.begin(), ff.end(), create_inserter<QualifiedPackageName>(r->inserter()));
}
else
- Log::get_instance()->message(ll_warning, lc_context) << "Blacklist data file '" << f << "' does not exist";
+ Log::get_instance()->message("e.qa.spec_keys_check.configuration_error", ll_warning, lc_context)
+ << "Blacklist data file '" << f << "' does not exist";
map.insert(std::make_pair(s, r));
return r;
@@ -517,7 +518,7 @@ paludis::erepository::spec_keys_check(
const std::string & name)
{
Context context("When performing check '" + name + "' using spec_keys_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "spec_keys_check '"
+ Log::get_instance()->message("e.qa.spec_keys_check", ll_debug, lc_context) << "spec_keys_check '"
<< entry << "', " << *id << "', " << name << "'";
using namespace tr1::placeholders;
diff --git a/paludis/repositories/e/qa/stray_files.cc b/paludis/repositories/e/qa/stray_files.cc
index 941bfdc..5dee2c4 100644
--- a/paludis/repositories/e/qa/stray_files.cc
+++ b/paludis/repositories/e/qa/stray_files.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
@@ -39,7 +39,7 @@ paludis::erepository::stray_files_check(
)
{
Context context("When performing check '" + name + "' using stray_files_check on directory '" + stringify(dir) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "stray_files_check '"
+ Log::get_instance()->message("e.qa.stray_files_check", ll_debug, lc_context) << "stray_files_check '"
<< repo->name() << "', '" << dir << "', " << name << "'";
if (dir.exists())
diff --git a/paludis/repositories/e/qa/subshell_die.cc b/paludis/repositories/e/qa/subshell_die.cc
index 17a272d..29bfe4e 100644
--- a/paludis/repositories/e/qa/subshell_die.cc
+++ b/paludis/repositories/e/qa/subshell_die.cc
@@ -49,10 +49,10 @@ paludis::erepository::subshell_die_check(
pcrepp::Pcre::Pcre r_subshell_die("\\([^\\)]*\\bdie\\b");
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "subshell_die '"
+ Log::get_instance()->message("e.qa.subshell_die_check", ll_debug, lc_context) << "subshell_die '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "subshell_die '"
+ Log::get_instance()->message("e.qa.subshell_die_check", ll_debug, lc_context) << "subshell_die '"
<< entry << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/variable_assigns.cc b/paludis/repositories/e/qa/variable_assigns.cc
index d17b08c..a57c9ff 100644
--- a/paludis/repositories/e/qa/variable_assigns.cc
+++ b/paludis/repositories/e/qa/variable_assigns.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -58,10 +58,10 @@ paludis::erepository::variable_assigns_check(
r_vars.insert(std::make_pair("ASFLAGS", pcrepp::Pcre::Pcre("\\bASFLAGS=")));
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "variable_assigns '"
+ Log::get_instance()->message("e.qa.variable_assigns_check", ll_debug, lc_context) << "variable_assigns '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "variable_assigns '"
+ Log::get_instance()->message("e.qa.variable_assigns_check", ll_debug, lc_context) << "variable_assigns '"
<< entry << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index cb4e832..3d77b59 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -170,7 +170,8 @@ namespace
}
else
{
- Log::get_instance()->message(ll_warning, lc_context) << "Probably a bug: don't know how to get masks for '"
+ Log::get_instance()->message("e.qa.visibility_check.no_masks", ll_warning, lc_context)
+ << "Probably a bug: don't know how to get masks for '"
<< **i << "' from '" << orig_p << "' -> '" << *p << "'";
continue;
}
@@ -268,7 +269,7 @@ paludis::erepository::visibility_check(
{
Context context("When performing check '" + name + "' using visibility_check on ID '" + stringify(*id) + "':");
- Log::get_instance()->message(ll_debug, lc_context) << "visibility_check '"
+ Log::get_instance()->message("e.qa.visibility_check", ll_debug, lc_context) << "visibility_check '"
<< entry << "', '" << *id << "', '" << name << "'";
if (repo->repository_masked(*id) || ! id->keywords_key())
diff --git a/paludis/repositories/e/qa/whitespace.cc b/paludis/repositories/e/qa/whitespace.cc
index 525de30..873e817 100644
--- a/paludis/repositories/e/qa/whitespace.cc
+++ b/paludis/repositories/e/qa/whitespace.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
@@ -46,10 +46,10 @@ paludis::erepository::whitespace_check(
Context context("When performing check '" + name + "' using whitespace_check on '" + (id ? stringify(*id) : stringify(entry)) + "':");
if (id)
- Log::get_instance()->message(ll_debug, lc_context) << "whitespace '"
+ Log::get_instance()->message("e.qa.whitespace_check", ll_debug, lc_context) << "whitespace '"
<< entry << "', '" << *id << "', '" << name << "'";
else
- Log::get_instance()->message(ll_debug, lc_context) << "whitespace '"
+ Log::get_instance()->message("e.qa.whitespace_check", ll_debug, lc_context) << "whitespace '"
<< entry << "', '" << name << "'";
std::stringstream ff(content);
diff --git a/paludis/repositories/e/registration.cc b/paludis/repositories/e/registration.cc
index 88c9523..6016747 100644
--- a/paludis/repositories/e/registration.cc
+++ b/paludis/repositories/e/registration.cc
@@ -48,8 +48,8 @@ namespace
Context context("When creating repository using '" + repo_file + "':");
- Log::get_instance()->message(ll_warning, lc_context, "Format 'portage' is "
- "deprecated, use 'ebuild' instead");
+ Log::get_instance()->message("e.portage.configuration.deprecated", ll_warning, lc_context)
+ << "Format 'portage' is deprecated, use 'ebuild' instead";
return make_ebuild_repository_wrapped(env, m);
}
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index 10b5c1c..af02449 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -130,11 +130,12 @@ SourceURIFinder::add_local_mirrors()
tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->env->mirrors("*"));
if (mirrors->empty())
- Log::get_instance()->message(ll_debug, lc_context) << "Mirrors set is empty";
+ Log::get_instance()->message("e.source_uri_finder.no_mirrors", ll_debug, lc_context) << "Mirrors set is empty";
for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
_imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + _imp->filename, _imp->filename));
}
}
@@ -146,11 +147,12 @@ SourceURIFinder::add_mirrors()
tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->env->mirrors(_imp->mirrors_name));
if (mirrors->empty())
- Log::get_instance()->message(ll_debug, lc_context) << "Environment mirrors set is empty";
+ Log::get_instance()->message("e.source_uri_finder.no_mirrors", ll_debug, lc_context) << "Environment mirrors set is empty";
for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
_imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + _imp->filename, _imp->filename));
}
@@ -161,7 +163,8 @@ SourceURIFinder::add_mirrors()
m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(_imp->mirrors_name)) ;
m != m_end ; ++m)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(m->second, "/") << "/" << _imp->filename;
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(m->second, "/") << "/" << _imp->filename;
_imp->items.push_back(std::make_pair(strip_trailing(m->second, "/") + "/" + _imp->filename, _imp->filename));
}
}
@@ -185,10 +188,11 @@ SourceURIFinder::add_listed()
Context local_context("When adding from environment for listed mirror '" + mirror + "':");
tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->env->mirrors(mirror));
if (mirrors->empty())
- Log::get_instance()->message(ll_debug, lc_context) << "Mirrors set is empty";
+ Log::get_instance()->message("e.source_uri_finder.no_mirrors", ll_debug, lc_context) << "Mirrors set is empty";
for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(*m, "/") << "/" << original_name;
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/") << "/" << original_name;
_imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + original_name, _imp->filename));
}
}
@@ -200,7 +204,8 @@ SourceURIFinder::add_listed()
m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(mirror)) ;
m != m_end ; ++m)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(m->second, "/")
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(m->second, "/")
<< "/" << original_name;
_imp->items.push_back(std::make_pair(strip_trailing(m->second, "/") + "/" + original_name, _imp->filename));
}
@@ -208,7 +213,7 @@ SourceURIFinder::add_listed()
}
else
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding " << _imp->url;
+ Log::get_instance()->message("e.source_uri_finder.adding", ll_debug, lc_context) << "Adding " << _imp->url;
_imp->items.push_back(std::make_pair(_imp->url, _imp->filename));
}
}
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index e071754..cb993c1 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -134,7 +134,7 @@ TraditionalLayout::need_category_names() const
Context context("When loading category names for " + stringify(_imp->repository->name()) + ":");
- Log::get_instance()->message(ll_debug, lc_context, "need_category_names");
+ Log::get_instance()->message("e.traditional_layout.need_category_names", ll_debug, lc_context) << "need_category_names";
bool found_one(false);
@@ -160,9 +160,9 @@ TraditionalLayout::need_category_names() const
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping line '"
- + *line + "' in '" + stringify(*i) + "' due to exception '"
- + stringify(e.message()) + "' ('" + e.what() + ")");
+ Log::get_instance()->message("e.traditional_layout.categories.failure", ll_warning, lc_context)
+ << "Skipping line '" << *line << "' in '" << *i << "' due to exception '"
+ << e.message() << "' ('" << e.what() << ")";
}
}
@@ -171,8 +171,8 @@ TraditionalLayout::need_category_names() const
if (! found_one)
{
- Log::get_instance()->message(ll_qa, lc_context, "No categories file for repository at '"
- + stringify(_imp->tree_root) + "', faking it");
+ Log::get_instance()->message("e.traditional_layout.categories.no_file", ll_qa, lc_context)
+ << "No categories file for repository at '" << _imp->tree_root << "', faking it";
for (DirIterator d(_imp->tree_root, DirIteratorOptions() + dio_inode_sort), d_end ; d != d_end ; ++d)
{
if (! d->is_directory_or_symlink_to_directory())
@@ -223,9 +223,9 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, *e));
if (indirect_iterator(v->end()) != std::find_if(indirect_iterator(v->begin()), indirect_iterator(v->end()),
tr1::bind(std::equal_to<VersionSpec>(), id->version(), tr1::bind(tr1::mem_fn(&PackageID::version), _1))))
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring entry '" + stringify(*e)
- + "' for '" + stringify(n) + "' in repository '" + stringify(_imp->repository->name())
- + "' because another equivalent version already exists");
+ Log::get_instance()->message("e.traditional_layout.id.duplicate", ll_warning, lc_context)
+ << "Ignoring entry '" << *e << "' for '" << n << "' in repository '" << _imp->repository->name()
+ << "' because another equivalent version already exists";
else
v->push_back(id);
}
@@ -235,10 +235,10 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
}
catch (const Exception & ee)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping entry '"
- + stringify(*e) + "' for '" + stringify(n) + "' in repository '"
- + stringify(_imp->repository->name()) + "' due to exception '" + ee.message() + "' ("
- + ee.what() + ")'");
+ Log::get_instance()->message("e.traditional_layout.id.failure", ll_warning, lc_context)
+ << "Skipping entry '" << *e << "' for '" << n << "' in repository '"
+ << _imp->repository->name() << "' due to exception '" << ee.message() << "' ("
+ << ee.what() << ")'";
}
}
@@ -355,9 +355,9 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Skipping entry '" +
- d->basename() + "' in category '" + stringify(c) + "' in repository '"
- + stringify(_imp->repository->name()) + "' (" + e.message() + ")");
+ Log::get_instance()->message("e.traditional_layout.packages.failure", ll_warning, lc_context) << "Skipping entry '" <<
+ d->basename() << "' in category '" << c << "' in repository '" <<
+ stringify(_imp->repository->name()) << "' (" << e.message() << ")";
}
}
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index d62a470..0a9a722 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -177,7 +177,7 @@ void
VDBMerger::on_warn(bool is_check, const std::string & s)
{
if (is_check)
- Log::get_instance()->message(ll_warning, lc_context, s);
+ Log::get_instance()->message("e.vdb_merger.warning", ll_warning, lc_context) << s;
}
bool
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 41285c1..eeee4e4 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -296,7 +296,7 @@ VDBRepository::make_vdb_repository(
if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty())
deprecated_world = "/DOESNOTEXIST";
else
- Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " <<
+ Log::get_instance()->message("e.vdb.configuration.deprecated", ll_warning, lc_context) << "Specifying world location " <<
"in repository configuration files is deprecated. File '" << deprecated_world << "' will be "
"read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
"the FAQ Upgrades section.";
@@ -308,9 +308,9 @@ VDBRepository::make_vdb_repository(
env->default_distribution()))[k::default_vdb_provides_cache()];
if (provides_cache.empty())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "The provides_cache key is not set in '"
- + repo_file + "'. You should read the Paludis documentation and select an "
- "appropriate value.");
+ Log::get_instance()->message("e.vdb.configuration.no_provides_cache", ll_warning, lc_no_context)
+ << "The provides_cache key is not set in '" << repo_file
+ << "'. You should read the Paludis documentation and select an appropriate value.";
provides_cache = "/var/empty";
}
}
@@ -322,9 +322,9 @@ VDBRepository::make_vdb_repository(
env->default_distribution()))[k::default_vdb_names_cache()];
if (names_cache.empty())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "The names_cache key is not set in '"
- + repo_file + "'. You should read the Paludis documentation and select an "
- "appropriate value.");
+ Log::get_instance()->message("e.vdb.configuration.no_names_cache", ll_warning, lc_no_context)
+ << "The names_cache key is not set in '" << repo_file
+ <<"'. You should read the Paludis documentation and select an appropriate value.";
names_cache = "/var/empty";
}
}
@@ -336,7 +336,8 @@ VDBRepository::make_vdb_repository(
builddir = (*DistributionData::get_instance()->distribution_from_string(
env->default_distribution()))[k::default_ebuild_builddir()];
else
- Log::get_instance()->message(ll_warning, lc_context) << "Key 'buildroot' is deprecated, use 'builddir' instead";
+ Log::get_instance()->message("e.vdb.configuration.deprecated", ll_warning, lc_context)
+ << "Key 'buildroot' is deprecated, use 'builddir' instead";
}
std::string name;
@@ -510,7 +511,7 @@ VDBRepository::provided_packages() const
tr1::shared_ptr<const ERepositoryID> id(package_id_if_exists(it->first.first, it->first.second));
if (! id)
{
- Log::get_instance()->message(ll_warning, lc_context) <<
+ Log::get_instance()->message("e.vdb.provides.no_package", ll_warning, lc_context) <<
"No package available for '" << it->first.first << " " << it->first.second << "'";
continue;
}
@@ -538,8 +539,8 @@ VDBRepository::load_provided_using_cache() const
if (! _imp->params.provides_cache.is_regular_file())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Provides cache at '"
- + stringify(_imp->params.provides_cache) + "' is not a regular file.");
+ Log::get_instance()->message("e.vdb.provides_cache.not_regular_file", ll_warning, lc_no_context)
+ << "Provides cache at '" << _imp->params.provides_cache << "' is not a regular file.";
return false;
}
@@ -550,8 +551,8 @@ VDBRepository::load_provided_using_cache() const
if (version != "paludis-3")
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Can't use provides cache at '"
- + stringify(_imp->params.provides_cache) + "' because format '" + version + "' is not 'paludis-3'");
+ Log::get_instance()->message("e.vdb.provides_cache.unsupported", ll_warning, lc_no_context) << "Can't use provides cache at '"
+ << _imp->params.provides_cache << "' because format '" << version << "' is not 'paludis-3'";
return false;
}
@@ -559,9 +560,9 @@ VDBRepository::load_provided_using_cache() const
std::getline(provides_cache, for_name);
if (for_name != stringify(name()))
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Can't use provides cache at '"
- + stringify(_imp->params.provides_cache) + "' because it was generated for repository '"
- + for_name + "'. You must not have multiple provides caches at the same location.");
+ Log::get_instance()->message("e.vdb.provides_cache.unusable", ll_warning, lc_no_context)
+ << "Can't use provides cache at '" << _imp->params.provides_cache << "' because it was generated for repository '"
+ << for_name << "'. You must not have multiple provides caches at the same location.";
return false;
}
@@ -576,8 +577,8 @@ VDBRepository::load_provided_using_cache() const
tokenise_whitespace(line, std::back_inserter(tokens));
if (tokens.size() < 3)
{
- Log::get_instance()->message(ll_warning, lc_context, "Not using PROVIDES cache line '" +
- line + "' as it contains fewer than three tokens");
+ Log::get_instance()->message("e.vdb.provides_cache.malformed", ll_warning, lc_context)
+ << "Not using PROVIDES cache line '" << line << "' as it contains fewer than three tokens";
continue;
}
@@ -588,8 +589,8 @@ VDBRepository::load_provided_using_cache() const
std::copy(tokens.begin() + 2, tokens.end(), create_inserter<QualifiedPackageName>(qpns->back_inserter()));
if (_imp->provides_map->end() != _imp->provides_map->find(std::make_pair(q, v)))
- Log::get_instance()->message(ll_warning, lc_context, "Not using PROVIDES cache line '" +
- line + "' as it names a package that has already been specified");
+ Log::get_instance()->message("e.vdb.provides_cache.duplicate", ll_warning, lc_context)
+ << "Not using PROVIDES cache line '" << line << "' as it names a package that has already been specified";
else
_imp->provides_map->insert(std::make_pair(std::make_pair(q, v), qpns));
}
@@ -599,8 +600,8 @@ VDBRepository::load_provided_using_cache() const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Not using PROVIDES cache line '" +
- line + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("e.vdb.provides_cache.unusable", ll_warning, lc_context)
+ << "Not using PROVIDES cache line '" << line << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
@@ -630,8 +631,8 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
QualifiedPackageName pp((*p)->text());
if (pp.category != CategoryNamePart("virtual"))
- Log::get_instance()->message(ll_warning, lc_no_context, "PROVIDE of non-virtual '"
- + stringify(pp) + "' from '" + stringify(id) + "' will not work as expected");
+ Log::get_instance()->message("e.vdb.provide.non_virtual", ll_warning, lc_no_context)
+ << "PROVIDE of non-virtual '" << pp << "' from '" << id << "' will not work as expected";
qpns->push_back(pp);
}
@@ -656,9 +657,8 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
}
catch (const Exception & ee)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Skipping VDB PROVIDE entry for '"
- + stringify(id) + "' due to exception '"
- + stringify(ee.message()) + "' (" + stringify(ee.what()) + ")");
+ Log::get_instance()->message("e.vdb.provides.failure", ll_warning, lc_no_context) << "Skipping VDB PROVIDE entry for '"
+ << id << "' due to exception '" << ee.message() << "' (" << ee.what() << ")";
}
}
@@ -671,7 +671,7 @@ VDBRepository::load_provided_the_slow_way() const
Context context("When loading VDB PROVIDEs map the slow way:");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting VDB PROVIDEs map creation");
+ Log::get_instance()->message("e.vdb.provides.starting", ll_debug, lc_no_context) << "Starting VDB PROVIDEs map creation";
_imp->provides_map.reset(new ProvidesMap);
need_category_names();
@@ -687,7 +687,7 @@ VDBRepository::load_provided_the_slow_way() const
e != e_end ; ++e)
provides_from_package_id(**e);
- Log::get_instance()->message(ll_debug, lc_no_context) << "Done VDB PROVIDEs map creation";
+ Log::get_instance()->message("e.vdb.provides.done", ll_debug, lc_no_context) << "Done VDB PROVIDEs map creation";
}
void
@@ -698,7 +698,7 @@ VDBRepository::write_provides_cache() const
std::ofstream f(stringify(_imp->params.provides_cache).c_str());
if (! f)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Cannot write to '" <<
+ Log::get_instance()->message("e.vdb.provides.write_failed", ll_warning, lc_context) << "Cannot write to '" <<
_imp->params.provides_cache << "': " << std::strerror(errno);
return;
}
@@ -884,7 +884,7 @@ VDBRepository::need_category_names() const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping VDB category dir '"
+ Log::get_instance()->message("e.vdb.categories.failure", ll_warning, lc_context) << "Skipping VDB category dir '"
<< *d << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
@@ -927,7 +927,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Skipping VDB package dir '"
+ Log::get_instance()->message("e.vdb.packages.failure", ll_warning, lc_context) << "Skipping VDB package dir '"
<< *d << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 5acc4af..6b7d39b 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -208,7 +208,7 @@ VDBUnmerger::populate_unmerge_set()
std::vector<std::string> tokens;
if (! erepository::VDBContentsTokeniser::tokenise(line, std::back_inserter(tokens)))
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Malformed VDB entry '" + line + "'");
+ Log::get_instance()->message("e.vdb.contents.malformed", ll_warning, lc_no_context) << "Malformed VDB entry '" << line << "'";
continue;
}
@@ -241,7 +241,8 @@ VDBUnmerger::populate_unmerge_set()
add_unmerge_entry(tokens.at(1), et_dir, tr1::shared_ptr<ExtraInfo>());
}
else
- Log::get_instance()->message(ll_warning, lc_no_context, "Malformed VDB entry '" + line + "'");
+ Log::get_instance()->message("e.vdb.contents.malformed", ll_warning, lc_no_context)
+ << "Malformed VDB entry '" << line << "'";
}
}
@@ -259,8 +260,8 @@ VDBUnmerger::check_file(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) const
std::ifstream md5_file(stringify(_imp->options[k::root()] / f).c_str());
if (! md5_file)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot get md5 for '" +
- stringify(_imp->options[k::root()] / f) + "'");
+ Log::get_instance()->message("e.vdb.contents.md5_failed", ll_warning, lc_no_context)
+ << "Cannot get md5 for '" << (_imp->options[k::root()] / f) << "'";
display("--- [!md5?] " + stringify(f));
}
else if (MD5(md5_file).hexsum() != fie->_md5sum)
diff --git a/paludis/repositories/gems/gem_specifications.cc b/paludis/repositories/gems/gem_specifications.cc
index b03442f..49bce94 100644
--- a/paludis/repositories/gems/gem_specifications.cc
+++ b/paludis/repositories/gems/gem_specifications.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
@@ -132,7 +132,7 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_qa, lc_context) << "Skipping entry '"
+ Log::get_instance()->message("gems.id.failure", ll_qa, lc_context) << "Skipping entry '"
<< pv << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 1338bbb..90f9dfb 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -237,7 +237,7 @@ InstalledGemsRepository::need_ids() const
std::string::size_type h(s.rfind('-'));
if (std::string::npos == h)
{
- Log::get_instance()->message(ll_qa, lc_context) << "Unrecognised file name format '"
+ Log::get_instance()->message("gems.id.unrecognised", ll_qa, lc_context) << "Unrecognised file name format '"
<< *d << "' (no hyphen)";
continue;
}
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 83e2cbd..6dc04e2 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -311,7 +311,7 @@ UnpackagedID::perform_action(Action & action) const
libdir = "lib";
}
- Log::get_instance()->message(ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
+ Log::get_instance()->message("unpackaged.libdir", ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
UnpackagedStripper stripper(UnpackagedStripperOptions::named_create()
(k::image_dir(), fs_location_key()->value())
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 3a73350..0d21d3b 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -148,7 +148,7 @@ VirtualsRepository::need_names() const
Context context("When loading names for virtuals repository:");
- Log::get_instance()->message(ll_debug, lc_context, "VirtualsRepository need_names");
+ Log::get_instance()->message("virtuals.need_names", ll_debug, lc_context) << "VirtualsRepository need_names";
/* Determine our virtual name -> package mappings. */
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
@@ -213,7 +213,7 @@ VirtualsRepository::need_ids() const
Context context("When loading entries for virtuals repository:");
need_names();
- Log::get_instance()->message(ll_debug, lc_context, "VirtualsRepository need_entries");
+ Log::get_instance()->message("virtuals.need_entries", ll_debug, lc_context) << "VirtualsRepository need_entries";
IDMap my_ids;
@@ -227,9 +227,8 @@ VirtualsRepository::need_ids() const
qo_order_by_version));
if (matches->empty())
- Log::get_instance()->message(ll_warning, lc_context, "No packages matching '"
- + stringify(*v->second) + "' for virtual '"
- + stringify(v->first) + "'");
+ Log::get_instance()->message("virtuals.no_match", ll_warning, lc_context) << "No packages matching '"
+ << *v->second << "' for virtual '" << v->first << "'";
for (PackageIDSequence::ConstIterator m(matches->begin()), m_end(matches->end()) ;
m != m_end ; ++m)
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 5eaa0fc..b9cfee7 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -117,8 +117,9 @@ Repository::Repository(
std::map<std::string, std::string>::const_iterator i(
RepositoryBlacklist::get_instance()->items.find(stringify(name())));
if (RepositoryBlacklist::get_instance()->items.end() != i)
- Log::get_instance()->message(ll_warning, lc_no_context, "Repository '" + stringify(name()) +
- "' is blacklisted with reason '" + i->second + "'. Consult the FAQ for more details.");
+ Log::get_instance()->message("repository.blacklisted", ll_warning, lc_no_context)
+ << "Repository '" << stringify(name())
+ << "' is blacklisted with reason '" << i->second << "'. Consult the FAQ for more details.";
}
Repository::~Repository()
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index 230e80c..fda0d7f 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -86,18 +86,18 @@ Implementation<RepositoryNameCache>::find(const PackageNamePart & p) const
std::getline(vvf, line);
if (line != "paludis-2")
{
- Log::get_instance()->message(ll_warning, lc_context, "Names cache for '" + stringify(repo->name())
- + "' has version string '" + line + "', which is not supported. Was it generated using "
- "a different Paludis version?");
+ Log::get_instance()->message("repository.names_cache.unsupported", ll_warning, lc_context)
+ << "Names cache for '" << repo->name() << "' has version string '" << line
+ << "', which is not supported. Was it generated using a different Paludis version?";
usable = false;
return name_cache_map.end();
}
std::getline(vvf, line);
if (line != stringify(repo->name()))
{
- Log::get_instance()->message(ll_warning, lc_context, "Names cache for '" + stringify(repo->name())
- + "' was generated for repository '" + line + "', so it cannot be used. You must not "
- "have multiple name caches at the same location.");
+ Log::get_instance()->message("repository.names_cache.different", ll_warning, lc_context)
+ << "Names cache for '" << repo->name() << "' was generated for repository '" << line
+ << "', so it cannot be used. You must not have multiple name caches at the same location.";
usable = false;
return name_cache_map.end();
}
@@ -105,20 +105,22 @@ Implementation<RepositoryNameCache>::find(const PackageNamePart & p) const
}
else if ((location.dirname() / "_VERSION_").exists())
{
- Log::get_instance()->message(ll_warning, lc_context, "Names cache for '" + stringify(repo->name())
- + "' does not exist at '" + stringify(location) + "', but a names cache exists at '" +
- stringify(location.dirname()) + "'. This was probably generated by a Paludis version "
- "older than 0.18.0. The names cache now automatically appends the repository name to the "
- "directory. You probably want to manually remove '" + stringify(location.dirname()) +
- "' and then regenerate the cache.");
+ Log::get_instance()->message("repository.names_cache.old", ll_warning, lc_context)
+ << "Names cache for '" << repo->name() << "' does not exist at '" << location
+ << "', but a names cache exists at '" << location.dirname()
+ << "'. This was probably generated by a Paludis version "
+ "older than 0.18.0. The names cache now automatically appends the repository name to the "
+ "directory. You probably want to manually remove '" << location.dirname() <<
+ "' and then regenerate the cache.";
usable = false;
return name_cache_map.end();
}
else
{
- Log::get_instance()->message(ll_warning, lc_context, "Names cache for '" + stringify(repo->name())
- + "' has no version information, so cannot be used. Either it was generated using "
- "an older Paludis version or it has not yet been generated.");
+ Log::get_instance()->message("repository.names_cache.unversioned", ll_warning, lc_context)
+ << "Names cache for '" << repo->name()
+ << "' has no version information, so cannot be used. Either it was generated using "
+ "an older Paludis version or it has not yet been generated.";
usable = false;
return name_cache_map.end();
}
@@ -129,7 +131,8 @@ Implementation<RepositoryNameCache>::find(const PackageNamePart & p) const
{
std::ifstream f(stringify(ff).c_str());
if (! f)
- Log::get_instance()->message(ll_warning, lc_context, "Cannot read '" + stringify(ff) + "': " + std::strerror(errno));
+ Log::get_instance()->message("repository.names_cache.read_failed", ll_warning, lc_context)
+ << "Cannot read '" << ff << "': " << std::strerror(errno);
std::string line;
while (std::getline(f, line))
r->second.insert(CategoryNamePart(line));
@@ -151,7 +154,8 @@ Implementation<RepositoryNameCache>::update(const PackageNamePart & p, NameCache
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot unlink '" + stringify(ff) + "': " + e.message() + " (" + e.what() + ")");
+ Log::get_instance()->message("repository.names_cache.unlink_failed", ll_warning, lc_context)
+ << "Cannot unlink '" << ff << "': " << e.message() << " (" << e.what() << ")";
}
return;
}
@@ -159,7 +163,8 @@ Implementation<RepositoryNameCache>::update(const PackageNamePart & p, NameCache
std::ofstream f(stringify(ff).c_str());
if (! f)
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot write '" + stringify(ff) + "': " + std::strerror(errno));
+ Log::get_instance()->message("repository.names_cache.write_failed", ll_warning, lc_context)
+ << "Cannot write '" << ff << "': " << std::strerror(errno);
return;
}
@@ -237,8 +242,8 @@ RepositoryNameCache::regenerate_cache() const
std::ofstream f(stringify(_imp->location / stringify(e->first)).c_str());
if (! f)
{
- Log::get_instance()->message(ll_warning, lc_context, "Cannot write to '"
- + stringify(_imp->location) + "': " + std::strerror(errno));
+ Log::get_instance()->message("repository.names_cache.write_failed", ll_warning, lc_context)
+ << "Cannot write to '" << _imp->location << "': " << std::strerror(errno);
continue;
}
f << e->second;
@@ -251,8 +256,8 @@ RepositoryNameCache::regenerate_cache() const
f << _imp->repo->name() << std::endl;
}
else
- Log::get_instance()->message(ll_warning, lc_context, "Cannot write to '"
- + stringify(_imp->location) + "': " + std::strerror(errno));
+ Log::get_instance()->message("repository.names_cache.write_failed", ll_warning, lc_context)
+ << "Cannot write to '" << _imp->location << "': " << std::strerror(errno);
}
void
diff --git a/paludis/selinux/security_context.cc b/paludis/selinux/security_context.cc
index 358fd75..35a046c 100644
--- a/paludis/selinux/security_context.cc
+++ b/paludis/selinux/security_context.cc
@@ -245,8 +245,8 @@ tr1::shared_ptr<const SecurityContext> MatchPathCon::match(const std::string & p
security_context_t context;
if (0 != libselinux.matchpathcon(path.c_str(), mode, &context))
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Couldn't get default security context for '" + path + "'.");
+ Log::get_instance()->message("selinux.get_context", ll_warning, lc_no_context) <<
+ "Couldn't get default security context for '" << path << "'.";
// throw SELinuxException("Couldn't get default security context for '" + path + "'.");
}
else
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 8602d85..1a8a464 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.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
@@ -183,8 +183,8 @@ namespace
if (tokens.size() == 1)
{
- Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
- "' should start with '?' or '*', assuming '*'");
+ Log::get_instance()->message("set_file.no_operator", ll_warning, lc_context)
+ << "Line '" << line << "' should start with '?' or '*', assuming '*'";
tokens.insert(tokens.begin(), "*");
}
@@ -209,7 +209,8 @@ namespace
{
if (std::string::npos == tokens.at(1).find('/'))
{
- Log::get_instance()->message(ll_warning, lc_context, "? operator may not be used with a set name");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "? operator may not be used with a set name";
return;
}
@@ -220,22 +221,23 @@ namespace
if (spec->package_ptr())
{
if (! params.environment)
- Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
- "' uses ? operator but no environment is available");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "Line '" << line << "' uses ? operator but no environment is available";
else if (! params.environment->package_database()->query(query::Package(*spec->package_ptr()) &
query::InstalledAtRoot(params.environment->root()), qo_whatever)->empty())
result->add(tr1::shared_ptr<TreeLeaf<SetSpecTree, PackageDepSpec> >(
new TreeLeaf<SetSpecTree, PackageDepSpec>(spec)));
}
else
- Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
- "' uses ? operator but does not specify an unambiguous package");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "Line '" << line << "' uses ? operator but does not specify an unambiguous package";
}
else if ("?:" == tokens.at(0))
{
if (std::string::npos == tokens.at(1).find('/'))
{
- Log::get_instance()->message(ll_warning, lc_context, "?: operator may not be used with a set name");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "?: operator may not be used with a set name";
return;
}
@@ -246,8 +248,8 @@ namespace
if (spec->package_ptr())
{
if (! params.environment)
- Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
- "' uses ?: operator but no environment is available");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "Line '" << line << "' uses ?: operator but no environment is available";
else if (! params.environment->package_database()->query(query::Matches(
make_package_dep_spec()
.package(*spec->package_ptr())
@@ -257,12 +259,12 @@ namespace
new TreeLeaf<SetSpecTree, PackageDepSpec>(spec)));
}
else
- Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
- "' uses ? operator but does not specify an unambiguous package");
+ Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
+ << "Line '" << line << "' uses ? operator but does not specify an unambiguous package";
}
else
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring line '" + stringify(line) +
- "' because it does not start with '?' or '*'");
+ Log::get_instance()->message("set_file.ignoring_line", ll_warning, lc_context)
+ << "Ignoring line '" << line << "' because it does not start with '?' or '*'";
}
catch (const InternalError &)
{
@@ -270,8 +272,8 @@ namespace
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring line '" + stringify(line) +
- "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ Log::get_instance()->message("set_file.ignoring_line", ll_warning, lc_context)
+ << "Ignoring line '" << line << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
}
}
@@ -336,8 +338,8 @@ SimpleHandler::_create_contents() const
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Ignoring line '" + stringify(*i) +
- "' due to exception '" + e.message() + "' (" + e.what() + "'");
+ Log::get_instance()->message("set_file.ignoring_line", ll_warning, lc_context)
+ << "Ignoring line '" << *i << "' due to exception '" << e.message() << "' (" << e.what() << "'";
}
}
}
@@ -488,8 +490,9 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
if (exit_status != 0)
{
- Log::get_instance()->message(ll_warning, lc_context, "Set file script '" + stringify(_p.file_name) +
- "' returned non-zero exit status '" + stringify(exit_status) + "'");
+ Log::get_instance()->message("set_file.script.failure", ll_warning, lc_context)
+ << "Set file script '" << _p.file_name << "' returned non-zero exit status '"
+ << exit_status << "'";
_contents.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
}
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index dde7df4..ed41a44 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -174,8 +174,8 @@ ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
if (! v.result)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Skipping dep '"
- << a << "' because no suggested label is active";
+ Log::get_instance()->message("dep_list.show_suggest_visitor.skipping_suggested", ll_debug, lc_context)
+ << "Skipping dep '" << a << "' because no suggested label is active";
return;
}
}
@@ -189,7 +189,8 @@ ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
query::Matches(a), qo_order_by_version));
if (! installed_matches->empty())
{
- Log::get_instance()->message(ll_debug, lc_context) << "Suggestion '" << a << "' already matched by installed packages '"
+ Log::get_instance()->message("dep_list.show_suggest_visitor.already_installed", ll_debug, lc_context)
+ << "Suggestion '" << a << "' already matched by installed packages '"
<< join(indirect_iterator(installed_matches->begin()), indirect_iterator(installed_matches->end()), ", ")
<< "', not suggesting it";
return;
@@ -200,7 +201,8 @@ ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
query::Matches(a), qo_order_by_version));
if (matches->empty())
{
- Log::get_instance()->message(ll_warning, lc_context, "Nothing found for '" + stringify(a) + "'");
+ Log::get_instance()->message("dep_list.show_suggest_visitor.nothing_found", ll_warning, lc_context)
+ << "Nothing found for '" << a << "'";
return;
}
@@ -214,7 +216,8 @@ ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
return;
}
- Log::get_instance()->message(ll_warning, lc_context, "Nothing visible found for '" + stringify(a) + "'");
+ Log::get_instance()->message("dep_list.show_suggest_visitor.nothing_visible_found", ll_warning, lc_context)
+ << "Nothing visible found for '" << a << "'";
}
void
@@ -232,13 +235,15 @@ ShowSuggestVisitor::visit_leaf(const NamedSetDepSpec & s)
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("dep_list.show_suggest_visitor.unknown_set", ll_warning, lc_context)
+ << "Unknown set '" << s.name() << "'";
return;
}
if (! _imp->recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("dep_list.show_suggest_visitor.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
diff --git a/paludis/stripper.cc b/paludis/stripper.cc
index 1e17428..b65724a 100644
--- a/paludis/stripper.cc
+++ b/paludis/stripper.cc
@@ -122,7 +122,8 @@ Stripper::file_type(const FSEntry & f)
std::stringstream s;
if (0 != run_command(Command("file '" + stringify(f) + "'").with_captured_stdout_stream(&s)))
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't work out the file type of '" << f << "'";
+ Log::get_instance()->message("strip.identification_failed", ll_warning, lc_context)
+ << "Couldn't work out the file type of '" << f << "'";
return s.str();
}
@@ -133,7 +134,7 @@ Stripper::do_strip(const FSEntry & f, const std::string & options)
Context context("When stripping '" + stringify(f) + "':");
on_strip(f);
if (0 != run_command(Command("strip " + options + " '" + stringify(f) + "'")))
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't strip '" << f << "'";
+ Log::get_instance()->message("strip.failure", ll_warning, lc_context) << "Couldn't strip '" << f << "'";
}
void
@@ -167,9 +168,9 @@ Stripper::do_split(const FSEntry & f, const FSEntry & g)
}
if (0 != run_command(Command("objcopy --only-keep-debug '" + stringify(f) + "' '" + stringify(g) + "'")))
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't copy debug information for '" << f << "'";
+ Log::get_instance()->message("strip.failure", ll_warning, lc_context) << "Couldn't copy debug information for '" << f << "'";
else if (0 != run_command(Command("objcopy --add-gnu-debuglink='" + stringify(g) + "' '" + stringify(f) + "'")))
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't add debug link for '" << f << "'";
+ Log::get_instance()->message("strip.failure", ll_warning, lc_context) << "Couldn't add debug link for '" << f << "'";
else
{
FSEntry(g).chmod(g.permissions() & ~(S_IXGRP | S_IXUSR | S_IXOTH | S_IWOTH));
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index beb4c28..e81fb4e 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -61,7 +61,7 @@ DefaultSyncer::DefaultSyncer(const SyncerParams & params) :
if (q < p)
_remote = _remote.substr(q < p ? q + 1 : 0);
- Log::get_instance()->message(ll_debug, lc_context) << "looking for syncer protocol '"
+ Log::get_instance()->message("syncer.protocol", ll_debug, lc_context) << "looking for syncer protocol '"
+ stringify(format) << "'";
tr1::shared_ptr<const FSEntrySequence> syncer_dirs(_environment->syncers_dirs());
@@ -74,8 +74,8 @@ DefaultSyncer::DefaultSyncer(const SyncerParams & params) :
if (syncer.exists() && syncer.has_permission(fs_ug_owner, fs_perm_execute))
ok = true;
- Log::get_instance()->message(ll_debug, lc_no_context, "Trying '" + stringify(syncer) + "': "
- + (ok ? "ok" : "not ok"));
+ Log::get_instance()->message("syncer.trying_file", ll_debug, lc_no_context)
+ << "Trying '" << syncer << "': " << (ok ? "ok" : "not ok");
}
if (! ok)
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index bb42877..b1e0c96 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -327,13 +327,14 @@ namespace
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("uninstall_list.unknown_set", ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
return;
}
if (! recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("uninstall_list.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
@@ -412,9 +413,10 @@ UninstallList::add_unused_dependencies()
everything_except_uninstall_list_targets->inserter(),
PackageIDSetComparator());
- Log::get_instance()->message(ll_debug, lc_context, "everything_except_uninstall_list_targets is '"
- + join(indirect_iterator(everything_except_uninstall_list_targets->begin()),
- indirect_iterator(everything_except_uninstall_list_targets->end()), " ") + "'");
+ Log::get_instance()->message("uninstall_list.everything_except_uninstall_list_targets", ll_debug, lc_context)
+ << "everything_except_uninstall_list_targets is '"
+ << join(indirect_iterator(everything_except_uninstall_list_targets->begin()),
+ indirect_iterator(everything_except_uninstall_list_targets->end()), " ") << "'";
tr1::shared_ptr<const PackageIDSet> depped_upon_not_list(
collect_depped_upon(everything_except_uninstall_list_targets));
@@ -486,7 +488,7 @@ UninstallList::add_dependencies(const PackageID & e, const bool error)
{
if (! logged)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Adding '" << **i <<
+ Log::get_instance()->message("uninstall_list.adding", ll_debug, lc_context) << "Adding '" << **i <<
"' because it depends upon '" << e << "'";
logged = true;
}
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 80cc695..9ee57a9 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -234,10 +234,9 @@ paludis::parse_user_package_dep_spec(const std::string & ss, const UserPackageDe
if ('*' == s.at(s.length() - 1))
{
if (op != vo_equal)
- Log::get_instance()->message(ll_qa, lc_context,
- "Package dep spec '" + ss + "' uses * "
- "with operator '" + stringify(op) +
- "', pretending it uses the equals operator instead");
+ Log::get_instance()->message("user_dep_spec.bad_operator", ll_qa, lc_context) <<
+ "Package dep spec '" << ss << "' uses * "
+ "with operator '" << op << "', pretending it uses the equals operator instead";
op = vo_equal_star;
result.version_requirement(VersionRequirement(op, VersionSpec(s.substr(q, s.length() - q - 1))));
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index 2f724f9..b6a1a55 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -61,7 +61,7 @@ namespace paludis
{
}
- void message(const LogLevel l, const LogContext c, const std::string cs, const std::string s)
+ void message(const std::string id, const LogLevel l, const LogContext c, const std::string cs, const std::string s)
{
if (l >= log_level)
{
@@ -71,15 +71,15 @@ namespace paludis
switch (l)
{
case ll_debug:
- *stream << "[DEBUG] ";
+ *stream << "[DEBUG " << id << "] ";
continue;
case ll_qa:
- *stream << "[QA] ";
+ *stream << "[QA " << id << "] ";
continue;
case ll_warning:
- *stream << "[WARNING] ";
+ *stream << "[WARNING " << id << "] ";
continue;
case ll_silent:
@@ -153,10 +153,10 @@ Log::log_level() const
}
void
-Log::_message(const LogLevel l, const LogContext c, const std::string & s)
+Log::_message(const std::string & id, const LogLevel l, const LogContext c, const std::string & s)
{
if (lc_context == c)
- _imp->action_queue.enqueue(tr1::bind(tr1::mem_fn(&Implementation<Log>::message), _imp.get(), l, c,
+ _imp->action_queue.enqueue(tr1::bind(tr1::mem_fn(&Implementation<Log>::message), _imp.get(), id, l, c,
#ifdef PALUDIS_ENABLE_THREADS
# ifdef __linux__
"In thread ID '" + stringify(syscall(SYS_gettid)) + "':\n ... " +
@@ -166,26 +166,21 @@ Log::_message(const LogLevel l, const LogContext c, const std::string & s)
#endif
Context::backtrace("\n ... "), s));
else
- _imp->action_queue.enqueue(tr1::bind(tr1::mem_fn(&Implementation<Log>::message), _imp.get(), l, c, "", s));
+ _imp->action_queue.enqueue(tr1::bind(tr1::mem_fn(&Implementation<Log>::message), _imp.get(), id, l, c, "", s));
}
LogMessageHandler::LogMessageHandler(const LogMessageHandler & o) :
+ _id(o._id),
_message(o._message),
_log_level(o._log_level),
_log_context(o._log_context)
{
}
-void
-Log::message(const LogLevel l, const LogContext c, const std::string & s)
-{
- _message(l, c, s);
-}
-
LogMessageHandler
-Log::message(const LogLevel l, const LogContext c)
+Log::message(const std::string & id, const LogLevel l, const LogContext c)
{
- return LogMessageHandler(this, l, c);
+ return LogMessageHandler(this, id, l, c);
}
void
@@ -206,8 +201,9 @@ Log::set_program_name(const std::string & s)
_imp->action_queue.enqueue(tr1::bind(tr1::mem_fn(&Implementation<Log>::set_program_name), _imp.get(), s));
}
-LogMessageHandler::LogMessageHandler(Log * const ll, const LogLevel l, const LogContext c) :
+LogMessageHandler::LogMessageHandler(Log * const ll, const std::string & id, const LogLevel l, const LogContext c) :
_log(ll),
+ _id(id),
_log_level(l),
_log_context(c)
{
@@ -222,6 +218,6 @@ LogMessageHandler::_append(const std::string & s)
LogMessageHandler::~LogMessageHandler()
{
if (! std::uncaught_exception() && ! _message.empty())
- _log->_message(_log_level, _log_context, _message);
+ _log->_message(_id, _log_level, _log_context, _message);
}
diff --git a/paludis/util/log.hh b/paludis/util/log.hh
index 43088a5..605af64 100644
--- a/paludis/util/log.hh
+++ b/paludis/util/log.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -57,7 +57,7 @@ namespace paludis
private:
Log();
- void _message(const LogLevel, const LogContext, const std::string &);
+ void _message(const std::string & id, const LogLevel, const LogContext, const std::string &);
public:
/**
@@ -77,11 +77,6 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Log a message at the specified level.
- */
- void message(const LogLevel, const LogContext, const std::string &);
-
- /**
* Log a message.
*
* The return value can be appended to using
@@ -89,7 +84,8 @@ namespace paludis
* destroyed (that is to say, at the end of the statement), the log
* message is written.
*/
- LogMessageHandler message(const LogLevel, const LogContext) PALUDIS_ATTRIBUTE((warn_unused_result));
+ LogMessageHandler message(const std::string & id,
+ const LogLevel, const LogContext) PALUDIS_ATTRIBUTE((warn_unused_result));
/**
* Change the log stream.
@@ -115,16 +111,17 @@ namespace paludis
*/
class PALUDIS_VISIBLE LogMessageHandler
{
- friend LogMessageHandler Log::message(const LogLevel, const LogContext);
+ friend LogMessageHandler Log::message(const std::string &, const LogLevel, const LogContext);
private:
Log * _log;
+ std::string _id;
std::string _message;
LogLevel _log_level;
LogContext _log_context;
LogMessageHandler(const LogMessageHandler &);
- LogMessageHandler(Log * const, const LogLevel, const LogContext);
+ LogMessageHandler(Log * const, const std::string &, const LogLevel, const LogContext);
void operator= (const LogMessageHandler &);
void _append(const std::string & s);
diff --git a/paludis/util/log_TEST.cc b/paludis/util/log_TEST.cc
index 8117af5..a461240 100644
--- a/paludis/util/log_TEST.cc
+++ b/paludis/util/log_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -76,7 +76,7 @@ namespace test_cases
Log::get_instance()->set_log_level(ll_debug);
TEST_CHECK(s.str().empty());
- Log::get_instance()->message(ll_debug, lc_no_context) << "one";
+ Log::get_instance()->message("test.log", ll_debug, lc_no_context) << "one";
Log::get_instance()->complete_pending();
TEST_CHECK(! s.str().empty());
TEST_CHECK(std::string::npos != s.str().find("one"));
@@ -86,10 +86,10 @@ namespace test_cases
TEST_CHECK(t.str().empty());
Log::get_instance()->set_log_level(ll_warning);
- Log::get_instance()->message(ll_debug, lc_no_context) << "two";
+ Log::get_instance()->message("test.log", ll_debug, lc_no_context) << "two";
Log::get_instance()->complete_pending();
TEST_CHECK(t.str().empty());
- Log::get_instance()->message(ll_warning, lc_no_context) << "three" << "." << 14;
+ Log::get_instance()->message("test.log", ll_warning, lc_no_context) << "three" << "." << 14;
Log::get_instance()->complete_pending();
TEST_CHECK(! t.str().empty());
TEST_CHECK(std::string::npos == t.str().find("one"));
@@ -111,18 +111,18 @@ namespace test_cases
Log::get_instance()->set_log_level(ll_debug);
TEST_CHECK(s.str().empty());
- TEST_CHECK_THROWS(Log::get_instance()->message(ll_debug, lc_no_context) << throws_a_monkey(), Monkey);
+ TEST_CHECK_THROWS(Log::get_instance()->message("test.log", ll_debug, lc_no_context) << throws_a_monkey(), Monkey);
Log::get_instance()->complete_pending();
TEST_CHECK(s.str().empty());
- TEST_CHECK_THROWS(Log::get_instance()->message(ll_debug, lc_no_context)
+ TEST_CHECK_THROWS(Log::get_instance()->message("test.log", ll_debug, lc_no_context)
<< "one" << throws_a_monkey() << "two", Monkey);
Log::get_instance()->complete_pending();
TEST_CHECK(s.str().empty());
- TEST_CHECK_THROWS(Log::get_instance()->message(ll_debug, lc_no_context) << throws_a_monkey_when_stringified(), Monkey);
+ TEST_CHECK_THROWS(Log::get_instance()->message("test.log", ll_debug, lc_no_context) << throws_a_monkey_when_stringified(), Monkey);
Log::get_instance()->complete_pending();
TEST_CHECK(s.str().empty());
- TEST_CHECK_THROWS(Log::get_instance()->message(ll_debug, lc_no_context)
+ TEST_CHECK_THROWS(Log::get_instance()->message("test.log", ll_debug, lc_no_context)
<< "one" << throws_a_monkey_when_stringified() << "two", Monkey);
Log::get_instance()->complete_pending();
TEST_CHECK(s.str().empty());
diff --git a/paludis/util/pipe.cc b/paludis/util/pipe.cc
index c967a8a..7b1cf22 100644
--- a/paludis/util/pipe.cc
+++ b/paludis/util/pipe.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -34,7 +34,7 @@ Pipe::Pipe()
if (-1 == pipe(_fds))
throw InternalError(PALUDIS_HERE, "pipe(2) failed");
- Log::get_instance()->message(ll_debug, lc_context) << "Pipe FDs are '" << read_fd() << "', '"
+ Log::get_instance()->message("util.pipe.fds", ll_debug, lc_context) << "Pipe FDs are '" << read_fd() << "', '"
<< write_fd() << "'";
}
@@ -43,9 +43,9 @@ Pipe::~Pipe()
Context context("When destroying pipe FDs '" + stringify(read_fd()) + "', '" + stringify(write_fd()) + "'");
if (-1 != _fds[0])
if (-1 == close(_fds[0]))
- Log::get_instance()->message(ll_warning, lc_context) << "close(" << _fds[0] << ") -> " << strerror(errno);
+ Log::get_instance()->message("util.pipe.close", ll_warning, lc_context) << "close(" << _fds[0] << ") -> " << strerror(errno);
if (-1 != _fds[1])
if (-1 == close(_fds[1]))
- Log::get_instance()->message(ll_warning, lc_context) << "close(" << _fds[1] << ") -> " << strerror(errno);
+ Log::get_instance()->message("util.pipe.close", ll_warning, lc_context) << "close(" << _fds[1] << ") -> " << strerror(errno);
}
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index a31a358..8c94b41 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -261,11 +261,11 @@ Command::with_sandbox()
{
#if HAVE_SANDBOX
if (! getenv_with_default("PALUDIS_DO_NOTHING_SANDBOXY", "").empty())
- Log::get_instance()->message(ll_debug, lc_no_context,
- "PALUDIS_DO_NOTHING_SANDBOXY is set, not using sandbox");
+ Log::get_instance()->message("util.system.nothing_sandboxy", ll_debug, lc_no_context)
+ << "PALUDIS_DO_NOTHING_SANDBOXY is set, not using sandbox";
else if (! getenv_with_default("SANDBOX_ACTIVE", "").empty())
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Already inside sandbox, not spawning another sandbox instance");
+ Log::get_instance()->message("util.system.sandbox_in_sandbox", ll_warning, lc_no_context)
+ << "Already inside sandbox, not spawning another sandbox instance";
else
_imp->command = "sandbox " + _imp->command;
#endif
@@ -322,8 +322,8 @@ paludis::run_command(const Command & cmd)
+ " -- " + command;
cmd.echo_to_stderr();
- Log::get_instance()->message(ll_debug, lc_no_context, "execl /bin/sh -c " + command
- + " " + extras);
+ Log::get_instance()->message("util.system.execl", ll_debug, lc_no_context) << "execl /bin/sh -c " << command
+ << " " << extras;
tr1::shared_ptr<Pipe> internal_command_reader(new Pipe), pipe_command_reader, pipe_command_response, captured_stdout;
if (cmd.pipe_command_handler())
@@ -618,7 +618,7 @@ paludis::run_command(const Command & cmd)
throw RunCommandError("select failed: " + stringify(strerror(errno)));
else if (0 == retval)
{
- Log::get_instance()->message(ll_debug, lc_context) << "Waiting for child " << child << " to finish";
+ Log::get_instance()->message("util.system.wait", ll_debug, lc_context) << "Waiting for child " << child << " to finish";
continue;
}
else
@@ -653,9 +653,11 @@ paludis::run_command(const Command & cmd)
}
if (! pipe_command_buffer.empty())
- Log::get_instance()->message(ll_debug, lc_context) << "pipe_command_buffer is '" << pipe_command_buffer << "'";
+ Log::get_instance()->message("util.system.pipe_command_buffer", ll_debug, lc_context) <<
+ "pipe_command_buffer is '" << pipe_command_buffer << "'";
if (! internal_command_buffer.empty())
- Log::get_instance()->message(ll_debug, lc_context) << "internal_command_buffer is '" << internal_command_buffer << "'";
+ Log::get_instance()->message("util.system.internal_command_buffer", ll_debug, lc_context) <<
+ "internal_command_buffer is '" << internal_command_buffer << "'";
while (! pipe_command_buffer.empty())
{
@@ -670,12 +672,12 @@ paludis::run_command(const Command & cmd)
if (cmd.pipe_command_handler())
{
response = cmd.pipe_command_handler()(op);
- Log::get_instance()->message(ll_debug, lc_context) << "Pipe command op '" << op << "' response '"
- << response << "'";
+ Log::get_instance()->message("util.system.pipe_command_op", ll_debug, lc_context)
+ << "Pipe command op '" << op << "' response '" << response << "'";
}
else
- Log::get_instance()->message(ll_warning, lc_context) << "Pipe command op '" << op <<
- "' was requested but no handler defined. This is probably a bug...";
+ Log::get_instance()->message("util.system.no_pipe_op_handler", ll_warning, lc_context)
+ << "Pipe command op '" << op << "' was requested but no handler defined. This is probably a bug...";
ssize_t n(0);
while (! response.empty())
@@ -705,7 +707,7 @@ paludis::run_command(const Command & cmd)
{
op.erase(0, 4);
int status(-1);
- Log::get_instance()->message(ll_debug, lc_context) << "Got exit op '" << op << "'";
+ Log::get_instance()->message("util.system.exit_op", ll_debug, lc_context) << "Got exit op '" << op << "'";
if (-1 == waitpid(child, &status, 0))
std::cerr << "wait failed: " + stringify(strerror(errno)) + "'" << std::endl;
return destringify<int>(strip_leading(strip_trailing(op, " \r\n\t"), " \r\n\t"));
@@ -839,8 +841,8 @@ paludis::get_user_name(const uid_t u)
else
{
Context c("When getting user name for uid '" + stringify(u) + "':");
- Log::get_instance()->message(ll_warning, lc_context, "getpwuid("
- + stringify(u) + ") returned null");
+ Log::get_instance()->message("util.system.getpwuid", ll_warning, lc_context) <<
+ "getpwuid(" << u << ") returned null";
return stringify(u);
}
}
@@ -854,8 +856,8 @@ paludis::get_group_name(const gid_t u)
else
{
Context c("When getting group name for gid '" + stringify(u) + "':");
- Log::get_instance()->message(ll_warning, lc_context, "getgrgid("
- + stringify(u) + ") returned null");
+ Log::get_instance()->message("util.system.getgrgid", ll_warning, lc_context) <<
+ "getgrgid(" << u << + ") returned null";
return stringify(u);
}
}
diff --git a/paludis/util/system_TEST.cc b/paludis/util/system_TEST.cc
index 15c289e..670fc83 100644
--- a/paludis/util/system_TEST.cc
+++ b/paludis/util/system_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -46,7 +46,7 @@ namespace
#endif
for (int i(0) ; i < 1000 ; ++i)
- Log::get_instance()->message(ll_debug, lc_context) << "logging stuff";
+ Log::get_instance()->message("test.system", ll_debug, lc_context) << "logging stuff";
}
#ifdef PALUDIS_ENABLE_THREADS
diff --git a/paludis/util/thread.cc b/paludis/util/thread.cc
index 29afe3b..6fc1e83 100644
--- a/paludis/util/thread.cc
+++ b/paludis/util/thread.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
@@ -64,7 +64,7 @@ Thread::idle_adapter(const tr1::function<void () throw ()> & f)
{
#ifdef __linux__
if (-1 == setpriority(PRIO_PROCESS, syscall(SYS_gettid), std::max(19, getpriority(PRIO_PROCESS, 0) + 10)))
- Log::get_instance()->message(ll_warning, lc_context) << "Failed to setpriority: " << strerror(errno);
+ Log::get_instance()->message("util.thread.setpriority", ll_warning, lc_context) << "Failed to setpriority: " << strerror(errno);
#else
# warning "Don't know how to set thread priorities on your platform"
#endif
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index fbeecff..4024ad1 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -123,7 +123,7 @@ VersionSpec::VersionSpec(const std::string & text) :
throw BadVersionSpecError(text, "Expected number part not found at offset " + stringify(p));
if (number_part.size() > 8)
- Log::get_instance()->message(ll_qa, lc_context) <<
+ Log::get_instance()->message("version_spec.too_long", ll_qa, lc_context) <<
"Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
"(Paludis supports arbitrary lengths, but other package managers do not)";
@@ -183,7 +183,7 @@ VersionSpec::VersionSpec(const std::string & text) :
p = std::string::npos == q ? text.length() : q;
if (number_part.size() > 8)
- Log::get_instance()->message(ll_qa, lc_context) <<
+ Log::get_instance()->message("version_spec.too_long", ll_qa, lc_context) <<
"Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
"(Paludis supports arbitrary lengths, but other package managers do not)";
@@ -208,7 +208,7 @@ VersionSpec::VersionSpec(const std::string & text) :
p = std::string::npos == q ? text.length() : q;
if (number_part.size() > 8)
- Log::get_instance()->message(ll_qa, lc_context) <<
+ Log::get_instance()->message("version_spec.too_long", ll_qa, lc_context) <<
"Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
"(Paludis supports arbitrary lengths, but other package managers do not)";
@@ -250,7 +250,7 @@ VersionSpec::VersionSpec(const std::string & text) :
p = std::string::npos == q ? text.length() : q;
if (number_part.size() > 8)
- Log::get_instance()->message(ll_qa, lc_context) <<
+ Log::get_instance()->message("version_spec.too_long", ll_qa, lc_context) <<
"Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
"(Paludis supports arbitrary lengths, but other package managers do not)";
diff --git a/python/log.cc b/python/log.cc
index cba7089..58d1b1c 100644
--- a/python/log.cc
+++ b/python/log.cc
@@ -25,6 +25,14 @@ using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
+namespace
+{
+ void log_message(Log * const log, const std::string & id, const LogLevel l, const LogContext c, const std::string & s)
+ {
+ log->message(id, l, c) << s;
+ }
+}
+
void expose_log()
{
/**
@@ -38,8 +46,6 @@ void expose_log()
/**
* Log
*/
- void (Log::*message_ptr)(const LogLevel l, const LogContext c, const std::string & s) =
- &Log::message;
bp::class_<Log, boost::noncopyable>
(
"Log",
@@ -52,8 +58,8 @@ void expose_log()
"Singleton instance."
)
- .def("message", message_ptr,
- "message(LogLevel, LogContext, string) -> None\n"
+ .def("message", log_message,
+ "message(string, LogLevel, LogContext, string) -> None\n"
"Log a message at the specified leve."
)
diff --git a/python/log_TEST.py b/python/log_TEST.py
index 39e4778..c8d6a08 100755
--- a/python/log_TEST.py
+++ b/python/log_TEST.py
@@ -48,7 +48,7 @@ class TestCase_Log(unittest.TestCase):
l = Log.instance
l.log_level = LogLevel.SILENT
- l.message(LogLevel.DEBUG, LogContext.CONTEXT, "foooo")
+ l.message("python.test", LogLevel.DEBUG, LogContext.CONTEXT, "foooo")
if __name__ == "__main__":
diff --git a/ruby/log.cc b/ruby/log.cc
index 97cb012..7c446dd 100644
--- a/ruby/log.cc
+++ b/ruby/log.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -74,18 +74,18 @@ namespace
/*
* call-seq:
- * message(log_level, message)
+ * message(id, log_level, message)
*
* Log a message at the specified level.
*/
VALUE
- log_message(VALUE self, VALUE log_level, VALUE message)
+ log_message(VALUE self, VALUE id, VALUE log_level, VALUE message)
{
int l = NUM2INT(log_level);
if (l < 0 || l >= last_ll)
rb_raise(rb_eTypeError, "Log.log_message expects a valid LogLevel as the first parameter");
- Log::get_instance()->message(static_cast<LogLevel>(l), lc_no_context,
- stringify(StringValuePtr(message)));
+ Log::get_instance()->message(stringify(StringValuePtr(id)), static_cast<LogLevel>(l), lc_no_context)
+ << stringify(StringValuePtr(message));
return self;
}
@@ -103,7 +103,7 @@ namespace
rb_define_method(c_log, "log_level", RUBY_FUNC_CAST(&log_log_level), 0);
rb_define_method(c_log, "log_level=", RUBY_FUNC_CAST(&log_log_level_set), 1);
rb_define_method(c_log, "program_name=", RUBY_FUNC_CAST(&log_set_program_name), 1);
- rb_define_method(c_log, "message", RUBY_FUNC_CAST(&log_message), 2);
+ rb_define_method(c_log, "message", RUBY_FUNC_CAST(&log_message), 3);
/*
* Document-module: Paludis::LogLevel
diff --git a/ruby/log_TEST.rb b/ruby/log_TEST.rb
index dac154f..e680bed 100644
--- a/ruby/log_TEST.rb
+++ b/ruby/log_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh
+# Copyright (c) 2006, 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
@@ -72,7 +72,7 @@ module Paludis
class TestCase_LogMessage < Test::Unit::TestCase
def test_log_message
- Log.instance.message LogLevel::Warning, "This is a test warning message"
+ Log.instance.message "ruby.test", LogLevel::Warning, "This is a test warning message"
end
def test_log_message_bad
@@ -81,11 +81,11 @@ module Paludis
end
assert_raise TypeError do
- Log.instance.message "Warning", "This should fail"
+ Log.instance.message "ruby.test", "Warning", "This should fail"
end
assert_raise TypeError do
- Log.instance.message 456, "This should fail"
+ Log.instance.message "ruby.test", 456, "This should fail"
end
end
end
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 2902535..ff1ee88 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -102,13 +102,15 @@ namespace
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("adjutrix.find_insecure_packages.unknown_set", ll_warning, lc_context)
+ << "Unknown set '" << s.name() << "'";
return;
}
if (! recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("adjutrix.find_insecure_packages.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index d14e769..5b14cef 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -119,13 +119,15 @@ namespace
if (! set)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Unknown set '" << s.name() << "'";
+ Log::get_instance()->message("adjutrix.find_reverse_deps.unknown_set", ll_warning, lc_context)
+ << "Unknown set '" << s.name() << "'";
return;
}
if (! _recursing_sets.insert(s.name()).second)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Recursively defined set '" << s.name() << "'";
+ Log::get_instance()->message("adjutrix.find_reverse_deps.recursive_set", ll_warning, lc_context)
+ << "Recursively defined set '" << s.name() << "'";
return;
}
@@ -317,8 +319,8 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
if (entries->empty())
{
- Log::get_instance()->message(ll_warning, lc_context, "No matches in package database for '"
- + stringify(*spec) + "'");
+ Log::get_instance()->message("adjutrix.find_reverse_deps.no_matches", ll_warning, lc_context)
+ << "No matches in package database for '" << *spec << "'";
return 1;
}
diff --git a/src/clients/contrarius/target_config.cc b/src/clients/contrarius/target_config.cc
index 7bd38c0..9b923e5 100644
--- a/src/clients/contrarius/target_config.cc
+++ b/src/clients/contrarius/target_config.cc
@@ -132,25 +132,15 @@ TargetConfig::TargetConfig() :
_parse_defaults();
_binutils = "cross-" + stringify(_target) + "/" + _find_match(_binutils_list);
- Log::get_instance()->message(ll_debug, lc_no_context, "Using configuration:\n"
- " binutils: " + _binutils + "\n");
_gcc = "cross-" + stringify(_target) + "/" + _find_match(_gcc_list);
- Log::get_instance()->message(ll_debug, lc_no_context, "Using configuration:\n"
- " gcc: " + _gcc + "\n");
_headers = _find_match(_headers_list);
if (! _headers.empty())
_headers = "cross-" + stringify(_target) + "/" + _find_match(_headers_list);
- Log::get_instance()->message(ll_debug, lc_no_context, "Using configuration:\n"
- " headers: " + (_headers.empty() ? "[none]" : _headers) + "\n");
_libc = "cross-" + stringify(_target) + "/" + _find_match(_libc_list);
- Log::get_instance()->message(ll_debug, lc_no_context, "Using configuration:\n"
- " libc: " + _libc + "\n");
_aux = _find_match(_aux_list);
- Log::get_instance()->message(ll_debug, lc_no_context, "Using configuration:\n"
- " aux: " + _aux + "\n");
}
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index 5fd0d55..165e5b5 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -146,8 +146,8 @@ namespace
}
catch (const Exception & ex)
{
- Log::get_instance()->message(ll_warning, lc_context,
- "Caught exception while handling '" + stringify(**i) + "': '" + ex.message() + "' (" + ex.what() + ")");
+ Log::get_instance()->message("inquisitio.failure", ll_warning, lc_context)
+ << "Caught exception while handling '" << **i << "': '" << ex.message() << "' (" << ex.what() << ")";
}
}
diff --git a/src/clients/inquisitio/inquisitio.cc b/src/clients/inquisitio/inquisitio.cc
index 2cee553..9c16f44 100644
--- a/src/clients/inquisitio/inquisitio.cc
+++ b/src/clients/inquisitio/inquisitio.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
@@ -89,9 +89,9 @@ main(int argc, char *argv[])
std::string paludis_command(argv[0]), env_spec;
if (CommandLine::get_instance()->a_config_suffix.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "--config-suffix is deprecated, use --environment ':" +
- CommandLine::get_instance()->a_config_suffix.argument() + "'");
+ Log::get_instance()->message("inquisitio.command_line.deprecated", ll_warning, lc_no_context)
+ << "--config-suffix is deprecated, use --environment ':" <<
+ CommandLine::get_instance()->a_config_suffix.argument() << "'";
env_spec = ":" + CommandLine::get_instance()->a_config_suffix.argument();
paludis_command.append(" --" + CommandLine::get_instance()->a_config_suffix.long_name() + " " +
CommandLine::get_instance()->a_config_suffix.argument());
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 39cb42a..5c7057c 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -208,10 +208,10 @@ int do_best_version(tr1::shared_ptr<Environment> env)
if (! (*entries->last())->virtual_for_key())
break;
- Log::get_instance()->message(ll_qa, lc_context) << "best-version of '" << query <<
- "' resolves to '" << **entries->last() << "', which is a virtual for '"
- << *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
- "new style virtuals.";
+ Log::get_instance()->message("paludis.best_version.is_virtual", ll_qa, lc_context) << "best-version of '" << query <<
+ "' resolves to '" << **entries->last() << "', which is a virtual for '"
+ << *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
+ "new style virtuals.";
tr1::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
new_entries->push_back((*entries->last())->virtual_for_key()->value());
entries = new_entries;
@@ -247,7 +247,7 @@ int do_match(tr1::shared_ptr<Environment> env)
if (! (*entries->last())->virtual_for_key())
break;
- Log::get_instance()->message(ll_qa, lc_context) << "match of '" << query <<
+ Log::get_instance()->message("paludis.match.is_virtual", ll_qa, lc_context) << "match of '" << query <<
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
@@ -380,8 +380,8 @@ int do_list_sync_protocols(tr1::shared_ptr<Environment> env)
if (0 != run_command(Command(s->second + " --help")
.with_setenv("PALUDIS_FETCHERS_DIRS", join(sd->begin(), sd->end(), " "))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))))
- Log::get_instance()->message(ll_warning, lc_context, "Syncer help command '" +
- s->second + " --help' failed");
+ Log::get_instance()->message("paludis.syncer_help.failure", ll_warning, lc_context)
+ << "Syncer help command '" << s->second << " --help' failed";
std::cout << std::endl;
}
}
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index 835a016..92159cc 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 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
@@ -114,14 +114,16 @@ main(int argc, char *argv[])
/* deprecated args */
if (CommandLine::get_instance()->a_dl_no_unnecessary_upgrades.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "--dl-no-unnecessary-upgrades / -U is deprecated");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--dl-no-unnecessary-upgrades / -U is deprecated";
CommandLine::get_instance()->dl_args.dl_upgrade.set_argument("as-needed");
CommandLine::get_instance()->dl_args.dl_upgrade.set_specified(true);
}
if (CommandLine::get_instance()->a_dl_drop_all.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "--dl-drop-all / -0 is deprecated");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--dl-drop-all / -0 is deprecated";
CommandLine::get_instance()->dl_args.dl_installed_deps_pre.set_argument("discard");
CommandLine::get_instance()->dl_args.dl_installed_deps_pre.set_specified(true);
CommandLine::get_instance()->dl_args.dl_installed_deps_post.set_argument("discard");
@@ -138,14 +140,16 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_dl_ignore_installed.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "--dl-ignore-installed / -e is deprecated");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--dl-ignore-installed / -e is deprecated";
CommandLine::get_instance()->dl_args.dl_reinstall.set_argument("always");
CommandLine::get_instance()->dl_args.dl_reinstall.set_specified(true);
}
if (CommandLine::get_instance()->a_show_install_reasons.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "--show-install-reasons is deprecated, use --show-reasons");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--show-install-reasons is deprecated, use --show-reasons";
CommandLine::get_instance()->install_args.a_show_reasons.set_argument(
CommandLine::get_instance()->a_show_install_reasons.argument());
CommandLine::get_instance()->install_args.a_show_reasons.set_specified(true);
@@ -153,7 +157,8 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_add_to_world_atom.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "--add-to-world-atom is deprecated, use --add-to-world-spec");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--add-to-world-atom is deprecated, use --add-to-world-spec";
CommandLine::get_instance()->install_args.a_add_to_world_spec.set_argument(
CommandLine::get_instance()->a_add_to_world_atom.argument());
CommandLine::get_instance()->install_args.a_add_to_world_spec.set_specified(true);
@@ -161,8 +166,8 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_safe_resume.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context) <<
- "Safe resume support is now enabled by default; there is no need to pass --safe-resume";
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "Safe resume support is now enabled by default; there is no need to pass --safe-resume";
}
/* need an action */
@@ -265,9 +270,9 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_config_suffix.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "--config-suffix is deprecated, use --environment ':" +
- CommandLine::get_instance()->a_config_suffix.argument() + "'");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "--config-suffix is deprecated, use --environment ':" <<
+ CommandLine::get_instance()->a_config_suffix.argument() << "'";
env_spec = ":" + CommandLine::get_instance()->a_config_suffix.argument();
paludis_command.append(" --" + CommandLine::get_instance()->a_config_suffix.long_name() + " " +
@@ -467,8 +472,8 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_update_news.specified())
{
- Log::get_instance()->message(ll_warning, lc_no_context,
- "Calling --update-news is no longer useful or necessary");
+ Log::get_instance()->message("paludis.command_line.deprecated", ll_warning, lc_no_context)
+ << "Calling --update-news is no longer useful or necessary";
return EXIT_SUCCESS;
}
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
index 1afe569..9e95f19 100644
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
@@ -148,9 +148,9 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::str
std::find_if(search_dirs_pruned.begin(), search_dirs_pruned.end(),
ParentOf(*it)))
search_dirs_pruned.push_back(*it);
- Log::get_instance()->message(
- ll_debug, lc_context, "After resolving symlinks and pruning subdirectories, SEARCH_DIRS=\"" +
- join(search_dirs_pruned.begin(), search_dirs_pruned.end(), " ") + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
+ ll_debug, lc_context) << "After resolving symlinks and pruning subdirectories, SEARCH_DIRS=\"" <<
+ join(search_dirs_pruned.begin(), search_dirs_pruned.end(), " ") << "\"";
std::transform(_imp->config.begin_ld_so_conf(), _imp->config.end_ld_so_conf(),
std::inserter(_imp->extra_lib_dirs, _imp->extra_lib_dirs.begin()),
@@ -162,7 +162,8 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::str
for (Configuration::DirsIterator it(_imp->extra_lib_dirs.begin()),
it_end(_imp->extra_lib_dirs.end()); it_end != it; ++it)
{
- Log::get_instance()->message(ll_debug, lc_context, "Need to check for extra libraries in '" + stringify(env->root() / *it) + "'");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Need to check for extra libraries in '" << (env->root() / *it) << "'";
#ifndef PALUDIS_TR1_FUNCTIONAL_IS_BOOST
std::for_each(_imp->checkers.begin(), _imp->checkers.end(),
tr1::bind(&LinkageChecker::add_extra_lib_dir, _1, env->root() / *it));
@@ -198,7 +199,8 @@ Implementation<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
dir = dir.dirname();
if (config.dir_is_masked(dir))
{
- Log::get_instance()->message(ll_debug, lc_context, "Skipping '" + stringify(directory) + "' because '" + stringify(dir) + "' is search-masked");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.skipping", ll_debug, lc_context)
+ << "Skipping '" << directory << "' because '" << dir << "' is search-masked";
return;
}
}
@@ -208,7 +210,8 @@ Implementation<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
if (with_root.is_directory())
walk_directory(with_root);
else
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(directory) + "' is missing or not a directory");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
+ << "'" << directory << "' is missing or not a directory";
}
void
@@ -219,11 +222,13 @@ Implementation<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
FSEntry without_root(directory.strip_leading(env->root()));
if (config.dir_is_masked(without_root))
{
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(directory) + "' is search-masked");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.masked", ll_debug, lc_context)
+ << "'" << directory << "' is search-masked";
return;
}
- Log::get_instance()->message(ll_debug, lc_context, "Entering directory '" + stringify(directory) + "'");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.entering", ll_debug, lc_context)
+ << "Entering directory '" << directory << "'";
{
Lock l(mutex);
extra_lib_dirs.erase(without_root);
@@ -236,7 +241,7 @@ Implementation<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
}
catch (const FSError & ex)
{
- Log::get_instance()->message(ll_warning, lc_no_context, ex.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
}
}
@@ -271,18 +276,20 @@ Implementation<BrokenLinkageFinder>::check_file(const FSEntry & file)
if (checkers.end() ==
std::find_if(checkers.begin(), checkers.end(),
tr1::bind(&LinkageChecker::check_file, _1, file)))
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(file) + "' is not a recognised file type");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.unrecognised", ll_debug, lc_context)
+ << "'" << file << "' is not a recognised file type";
#else
if (indirect_iterator(checkers.end()) ==
std::find_if(indirect_iterator(checkers.begin()), indirect_iterator(checkers.end()),
tr1::bind(&LinkageChecker::check_file, _1, file)))
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(file) + "' is not a recognised file type");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.unrecognised", ll_debug, lc_context)
+ << "'" << file << "' is not a recognised file type";
#endif
}
}
catch (const FSError & ex)
{
- Log::get_instance()->message(ll_warning, lc_no_context, ex.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
}
}
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.cc b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
index a14805e..0bea927 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
@@ -81,7 +81,8 @@ namespace
std::string str(source.operator() (varname)); /* silly 4.3 ICE */
if (! str.empty())
{
- Log::get_instance()->message(ll_debug, lc_context, "Got " + varname + "=\"" + str + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Got " << varname << "=\"" + str << "\"";
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(str, ":", "", std::back_inserter(vec));
}
}
@@ -94,7 +95,8 @@ namespace
std::string str(source.operator() (varname)); /* silly 4.3 ICE */
if (! str.empty())
{
- Log::get_instance()->message(ll_debug, lc_context, "Got " + varname + "=\"" + str + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Got " << varname << "=\"" << str << "\"";
tokenise_whitespace(str, std::back_inserter(vec));
}
}
@@ -128,9 +130,9 @@ namespace
std::sort(vec.begin(), vec.end());
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
- Log::get_instance()->message(
- ll_debug, lc_context, "Final " + varname + "=\"" +
- join(vec.begin(), vec.end(), " ") + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
+ ll_debug, lc_context) << "Final " << varname << "=\"" <<
+ join(vec.begin(), vec.end(), " ") << "\"";
}
}
@@ -153,9 +155,9 @@ Configuration::Configuration(const FSEntry & root) :
std::sort(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end());
_imp->ld_so_conf.erase(std::unique(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end()),
_imp->ld_so_conf.end());
- Log::get_instance()->message(
- ll_debug, lc_context, "Final ld.so.conf contents is \"" +
- join(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end(), " ") + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
+ ll_debug, lc_context) << "Final ld.so.conf contents is \"" <<
+ join(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end(), " ") << "\"";
}
Configuration::~Configuration()
@@ -215,11 +217,13 @@ Implementation<Configuration>::load_from_etc_revdep_rebuild(const FSEntry & root
from_string(fromfile, "SEARCH_DIRS_MASK", search_dirs_mask);
}
else
- Log::get_instance()->message(ll_warning, lc_context, "'" + stringify(*it) + "' is not a regular file");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_context)
+ << "'" << *it << "' is not a regular file";
}
}
else if (etc_revdep_rebuild.exists())
- Log::get_instance()->message(ll_warning, lc_context, "'" + stringify(etc_revdep_rebuild) + "' exists but is not a directory");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_revdep_rebuild.not_a_directory", ll_warning, lc_context)
+ << "'" << etc_revdep_rebuild << "' exists but is not a directory";
}
void
@@ -246,7 +250,8 @@ Implementation<Configuration>::load_from_etc_profile_env(const FSEntry & root)
from_colon_string(fromfile, "ROOTPATH", search_dirs);
}
else if (etc_profile_env.exists())
- Log::get_instance()->message(ll_warning, lc_context, "'" + stringify(etc_profile_env) + "' exists but is not a regular file");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_profile_env.not_a_file", ll_warning, lc_context)
+ << "'" << etc_profile_env << "' exists but is not a regular file";
}
void
@@ -263,13 +268,15 @@ Implementation<Configuration>::load_from_etc_ld_so_conf(const FSEntry & root)
LineConfigFile lines(etc_ld_so_conf, opts);
if (lines.begin() != lines.end())
{
- Log::get_instance()->message(ll_debug, lc_context, "Got " + join(lines.begin(), lines.end(), " "));
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.got", ll_debug, lc_context)
+ << "Got " << join(lines.begin(), lines.end(), " ");
std::copy(lines.begin(), lines.end(), std::back_inserter(search_dirs));
std::copy(lines.begin(), lines.end(), std::back_inserter(ld_so_conf));
}
}
else if (etc_ld_so_conf.exists())
- Log::get_instance()->message(ll_warning, lc_context, "'" + stringify(etc_ld_so_conf) + "' exists but is not a regular file");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_ld_so_conf.not_a_file", ll_warning, lc_context)
+ << "'" << etc_ld_so_conf << "' exists but is not a regular file";
}
void
@@ -285,19 +292,23 @@ Implementation<Configuration>::add_defaults()
"/opt/OpenOffice /usr/lib*/openoffice /lib*/modules");
static const std::string default_ld_so_conf("/lib /usr/lib");
- Log::get_instance()->message(ll_debug, lc_context, "Got LD_LIBRARY_MASK=\"" + default_ld_library_mask + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Got LD_LIBRARY_MASK=\"" << default_ld_library_mask << "\"";
tokenise_whitespace(
default_ld_library_mask, std::back_inserter(ld_library_mask));
- Log::get_instance()->message(ll_debug, lc_context, "Got SEARCH_DIRS=\"" + default_search_dirs + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Got SEARCH_DIRS=\"" << default_search_dirs << "\"";
tokenise_whitespace(
default_search_dirs, std::back_inserter(search_dirs));
- Log::get_instance()->message(ll_debug, lc_context, "Got SEARCH_DIRS_MASK=\"" + default_search_dirs_mask + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Got SEARCH_DIRS_MASK=\"" << default_search_dirs_mask << "\"";
tokenise_whitespace(
default_search_dirs_mask, std::back_inserter(search_dirs_mask));
- Log::get_instance()->message(ll_debug, lc_context, "Default ld.so.conf contents is \"" + default_ld_so_conf + "\"");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
+ << "Default ld.so.conf contents is \"" << default_ld_so_conf << "\"";
tokenise_whitespace(
default_ld_so_conf, std::back_inserter(ld_so_conf));
}
diff --git a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
index 76ccd83..227b426 100644
--- a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
@@ -172,7 +172,8 @@ Implementation<ElfLinkageChecker>::check_elf(const FSEntry & file, std::ifstream
ElfObject<ElfType_> elf(stream);
if (ET_EXEC != elf.get_type() && ET_DYN != elf.get_type())
{
- Log::get_instance()->message(ll_debug, lc_context, "File is not an executable or shared library");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.not_interesting", ll_debug, lc_context)
+ << "File is not an executable or shared library";
return true;
}
@@ -200,7 +201,8 @@ Implementation<ElfLinkageChecker>::check_elf(const FSEntry & file, std::ifstream
const std::string & req((*ent_str)());
if (library.empty() || library == req)
{
- Log::get_instance()->message(ll_debug, lc_context, "File depends on " + req);
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.depends", ll_debug, lc_context)
+ << "File depends on " << req;
needed[arch][req].push_back(file);
}
}
@@ -209,7 +211,8 @@ Implementation<ElfLinkageChecker>::check_elf(const FSEntry & file, std::ifstream
}
catch (const InvalidElfFileError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "'" + stringify(file) + "' appears to be invalid or corrupted: " + e.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.invalid", ll_warning, lc_no_context)
+ << "'" << file << "' appears to be invalid or corrupted: " << e.message();
}
return true;
@@ -224,9 +227,9 @@ Implementation<ElfLinkageChecker>::handle_library(const FSEntry & file, const El
if (range.first != range.second)
{
- Log::get_instance()->message(
- ll_debug, lc_context, "Known symlinks are " +
- join(second_iterator(range.first), second_iterator(range.second), " "));
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.known_symlinks_are",
+ ll_debug, lc_context) << "Known symlinks are " <<
+ join(second_iterator(range.first), second_iterator(range.second), " ");
std::transform(second_iterator(range.first), second_iterator(range.second),
std::back_inserter(libraries[arch]), tr1::mem_fn(&FSEntry::basename));
}
@@ -242,7 +245,8 @@ ElfLinkageChecker::note_symlink(const FSEntry & link, const FSEntry & target)
std::map<FSEntry, ElfArchitecture>::const_iterator it(_imp->seen.find(target));
if (_imp->seen.end() != it)
{
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(link) + "' is a symlink to known library '" + stringify(target) + "'");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.note_symlink", ll_debug, lc_context)
+ << "'" << link << "' is a symlink to known library '" << target << "'";
_imp->libraries[it->second].push_back(link.basename());
}
else
@@ -299,20 +303,23 @@ ElfLinkageChecker::need_breakage_added(
FSEntry file(dereference_with_root(*dir_it / missing_it->first, _imp->root));
if (! file.is_regular_file())
{
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(file) + "' is missing or not a regular file");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
+ << "'" << file << "' is missing or not a regular file";
continue;
}
std::ifstream stream(stringify(file).c_str());
if (! stream)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Error opening '" + stringify(file) + "': " + std::strerror(errno));
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context)
+ << "Error opening '" << file << "': " << std::strerror(errno);
continue;
}
if (! (_imp->check_extra_elf<Elf32Type>(file, stream, missing_it->second) ||
_imp->check_extra_elf<Elf64Type>(file, stream, missing_it->second)))
- Log::get_instance()->message(ll_debug, lc_no_context, "'" + stringify(file) + "' is not an ELF file");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.not_an_elf", ll_debug, lc_no_context)
+ << "'" << file << "' is not an ELF file";
}
}
@@ -340,15 +347,18 @@ Implementation<ElfLinkageChecker>::check_extra_elf(const FSEntry & file, std::is
ElfObject<ElfType_> elf(stream);
if (ET_DYN == elf.get_type())
{
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(file) + "' is a library");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.is_library", ll_debug, lc_context)
+ << "'" << file << "' is a library";
arches.erase(ElfArchitecture(elf));
}
else
- Log::get_instance()->message(ll_debug, lc_context, "'" + stringify(file) + "' is not a library");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.is_not_library", ll_debug, lc_context)
+ << "'" << file << "' is not a library";
}
catch (const InvalidElfFileError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "'" + stringify(file) + "' appears to be invalid or corrupted: " + e.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.invalid", ll_warning, lc_no_context)
+ << "'" << file << "' appears to be invalid or corrupted: " << e.message();
}
return true;
diff --git a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
index 36db4c0..9809035 100644
--- a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
@@ -107,14 +107,15 @@ LibtoolLinkageChecker::check_file(const FSEntry & file)
}
catch (const ConfigFileError & ex)
{
- Log::get_instance()->message(ll_warning, lc_context, ex.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_context) << ex.message();
return true;
}
deps.erase(std::remove_if(deps.begin(), deps.end(), IsNotAbsolutePath()), deps.end());
if (deps.empty())
{
- Log::get_instance()->message(ll_debug, lc_context, "No libtool library dependencies found");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.no_libtool", ll_debug, lc_context)
+ << "No libtool library dependencies found";
return true;
}
@@ -126,22 +127,22 @@ LibtoolLinkageChecker::check_file(const FSEntry & file)
FSEntry dep(_imp->root / *it);
if (! dereference_with_root(dep, _imp->root).is_regular_file())
{
- Log::get_instance()->message(
- ll_debug, lc_context, "Dependency '" + *it +
- "' is missing or not a regular file in '" + stringify(_imp->root) + "'");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.dependency_missing",
+ ll_debug, lc_context) << "Dependency '" << *it <<
+ "' is missing or not a regular file in '" << _imp->root << "'";
Lock l(_imp->mutex);
_imp->breakage.push_back(std::make_pair(file, *it));
}
else
- Log::get_instance()->message(ll_debug, lc_context, "Dependency '" + *it +
- "' exists in '" + stringify(_imp->root) + "'");
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.dependency_exists", ll_debug, lc_context)
+ << "Dependency '" << *it << "' exists in '" << _imp->root << "'";
}
catch (const FSError & ex)
{
- Log::get_instance()->message(ll_warning, lc_no_context, ex.message());
+ Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
}
}
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 7ba91f1..fdb4dfe 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -786,7 +786,8 @@ ConsoleInstallTask::display_use_summary_flag(const std::string & prefix,
Set<UseDescription, UseDescriptionComparator>::ConstIterator i,
Set<UseDescription, UseDescriptionComparator>::ConstIterator i_end)
{
- Log::get_instance()->message(ll_debug, lc_context) << "display_use_summary_flag: prefix is '" << prefix
+ Log::get_instance()->message("console_install_task.display_use_summary_flag.prefix", ll_debug, lc_context)
+ << "display_use_summary_flag: prefix is '" << prefix
<< "', i->flag is '" << i->flag << "', i->package_id is '" << *i->package_id << "', i->state is '" << i->state
<< "', i->description is '" << i->description << "'";
@@ -1684,7 +1685,8 @@ ConsoleInstallTask::on_all_masked_error(const AllMaskedError & e)
}
catch (...)
{
- Log::get_instance()->message(ll_warning, lc_context, "Couldn't work out a friendly error message for mask reasons");
+ Log::get_instance()->message("console_install_task.on_all_masked_error.no_friendly", ll_warning, lc_context)
+ << "Couldn't work out a friendly error message for mask reasons";
throw e;
}
}