[paludis-commits] r4569 - in trunk: . doc/api/cplusplus/examples paludis paludis/args paludis/environments/no_config paludis/environments/paludis paludis/environments/portage paludis/repositories/cran paludis/repositories/e paludis/repositories/e/qa paludis/repositories/gems paludis/repositories/unpackaged paludis/repositories/virtuals paludis/selinux paludis/util python ruby src/clients/adjutrix src/clients/contrarius src/clients/inquisitio src/clients/paludis src/clients/reconcilio/broken_linkage_finder src/output

ciaranm at svn.pioto.org ciaranm at svn.pioto.org
Wed Apr 16 14:01:16 UTC 2008


Author: ciaranm
Date: 2008-04-16 14:01:13 +0000 (Wed, 16 Apr 2008)
New Revision: 4569

Modified:
   trunk/ChangeLog
   trunk/doc/api/cplusplus/examples/example_dep_tree.cc
   trunk/paludis/args/dep_list_args_group.cc
   trunk/paludis/dep_list.cc
   trunk/paludis/dep_spec_flattener.cc
   trunk/paludis/environment_implementation.cc
   trunk/paludis/environments/no_config/no_config_environment.cc
   trunk/paludis/environments/paludis/bashable_conf.cc
   trunk/paludis/environments/paludis/keywords_conf.cc
   trunk/paludis/environments/paludis/licenses_conf.cc
   trunk/paludis/environments/paludis/package_mask_conf.cc
   trunk/paludis/environments/paludis/paludis_config.cc
   trunk/paludis/environments/paludis/paludis_environment.cc
   trunk/paludis/environments/paludis/use_conf.cc
   trunk/paludis/environments/paludis/world.cc
   trunk/paludis/environments/portage/portage_environment.cc
   trunk/paludis/hooker.cc
   trunk/paludis/install_task.cc
   trunk/paludis/merger.cc
   trunk/paludis/name.cc
   trunk/paludis/ndbam.cc
   trunk/paludis/ndbam_merger.cc
   trunk/paludis/ndbam_unmerger.cc
   trunk/paludis/package_database.cc
   trunk/paludis/python_hooks.cc
   trunk/paludis/query_visitor.cc
   trunk/paludis/report_task.cc
   trunk/paludis/repositories/cran/cran_package_id.cc
   trunk/paludis/repositories/cran/cran_repository.cc
   trunk/paludis/repositories/cran/description_file.cc
   trunk/paludis/repositories/e/check_fetched_files_visitor.cc
   trunk/paludis/repositories/e/conditional_dep_spec.cc
   trunk/paludis/repositories/e/e_installed_repository_id.cc
   trunk/paludis/repositories/e/e_key.cc
   trunk/paludis/repositories/e/e_repository.cc
   trunk/paludis/repositories/e/e_repository_news.cc
   trunk/paludis/repositories/e/e_repository_profile.cc
   trunk/paludis/repositories/e/e_repository_profile_file.cc
   trunk/paludis/repositories/e/e_repository_sets.cc
   trunk/paludis/repositories/e/ebuild.cc
   trunk/paludis/repositories/e/ebuild_entries.cc
   trunk/paludis/repositories/e/ebuild_flat_metadata_cache.cc
   trunk/paludis/repositories/e/ebuild_id.cc
   trunk/paludis/repositories/e/exheres_layout.cc
   trunk/paludis/repositories/e/exndbam_repository.cc
   trunk/paludis/repositories/e/fetch_visitor.cc
   trunk/paludis/repositories/e/make_ebuild_repository.cc
   trunk/paludis/repositories/e/manifest2_reader.cc
   trunk/paludis/repositories/e/package_dep_spec.cc
   trunk/paludis/repositories/e/pipe_command_handler.cc
   trunk/paludis/repositories/e/qa/categories.cc
   trunk/paludis/repositories/e/qa/changelog.cc
   trunk/paludis/repositories/e/qa/default_functions.cc
   trunk/paludis/repositories/e/qa/deprecated_functions.cc
   trunk/paludis/repositories/e/qa/ebuild_count.cc
   trunk/paludis/repositories/e/qa/extractors.cc
   trunk/paludis/repositories/e/qa/fetches_key.cc
   trunk/paludis/repositories/e/qa/files_dir_size.cc
   trunk/paludis/repositories/e/qa/function_keyword.cc
   trunk/paludis/repositories/e/qa/header.cc
   trunk/paludis/repositories/e/qa/homepage_key.cc
   trunk/paludis/repositories/e/qa/inherited_key.cc
   trunk/paludis/repositories/e/qa/iuse_key.cc
   trunk/paludis/repositories/e/qa/keywords_key.cc
   trunk/paludis/repositories/e/qa/kv_variables.cc
   trunk/paludis/repositories/e/qa/license_key.cc
   trunk/paludis/repositories/e/qa/manifest.cc
   trunk/paludis/repositories/e/qa/metadata_keys.cc
   trunk/paludis/repositories/e/qa/misc_files.cc
   trunk/paludis/repositories/e/qa/restrict_key.cc
   trunk/paludis/repositories/e/qa/root_variable.cc
   trunk/paludis/repositories/e/qa/short_description_key.cc
   trunk/paludis/repositories/e/qa/spec_keys.cc
   trunk/paludis/repositories/e/qa/stray_files.cc
   trunk/paludis/repositories/e/qa/subshell_die.cc
   trunk/paludis/repositories/e/qa/variable_assigns.cc
   trunk/paludis/repositories/e/qa/visibility.cc
   trunk/paludis/repositories/e/qa/whitespace.cc
   trunk/paludis/repositories/e/registration.cc
   trunk/paludis/repositories/e/source_uri_finder.cc
   trunk/paludis/repositories/e/traditional_layout.cc
   trunk/paludis/repositories/e/vdb_merger.cc
   trunk/paludis/repositories/e/vdb_repository.cc
   trunk/paludis/repositories/e/vdb_unmerger.cc
   trunk/paludis/repositories/gems/gem_specifications.cc
   trunk/paludis/repositories/gems/installed_gems_repository.cc
   trunk/paludis/repositories/unpackaged/unpackaged_id.cc
   trunk/paludis/repositories/virtuals/virtuals_repository.cc
   trunk/paludis/repository.cc
   trunk/paludis/repository_name_cache.cc
   trunk/paludis/selinux/security_context.cc
   trunk/paludis/set_file.cc
   trunk/paludis/show_suggest_visitor.cc
   trunk/paludis/stripper.cc
   trunk/paludis/syncer.cc
   trunk/paludis/uninstall_list.cc
   trunk/paludis/user_dep_spec.cc
   trunk/paludis/util/log.cc
   trunk/paludis/util/log.hh
   trunk/paludis/util/log_TEST.cc
   trunk/paludis/util/pipe.cc
   trunk/paludis/util/system.cc
   trunk/paludis/util/system_TEST.cc
   trunk/paludis/util/thread.cc
   trunk/paludis/version_spec.cc
   trunk/python/log.cc
   trunk/python/log_TEST.py
   trunk/ruby/log.cc
   trunk/ruby/log_TEST.rb
   trunk/src/clients/adjutrix/find_insecure_packages.cc
   trunk/src/clients/adjutrix/find_reverse_deps.cc
   trunk/src/clients/contrarius/target_config.cc
   trunk/src/clients/inquisitio/do_search.cc
   trunk/src/clients/inquisitio/inquisitio.cc
   trunk/src/clients/paludis/applets.cc
   trunk/src/clients/paludis/paludis.cc
   trunk/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
   trunk/src/clients/reconcilio/broken_linkage_finder/configuration.cc
   trunk/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
   trunk/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
   trunk/src/output/console_install_task.cc
Log:
Give log messages an id


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/ChangeLog	2008-04-16 14:01:13 UTC (rev 4569)
@@ -7,6 +7,10 @@
 
 2008-04-16 Ciaran McCreesh
 
+	* (lots): Give log messages an ID.
+
+2008-04-16 Ciaran McCreesh
+
 	* paludis/repositories/e/: Don't QA for failed -lines in profiles if
 	that line would have succeeded at any previous point.
 

Modified: trunk/doc/api/cplusplus/examples/example_dep_tree.cc
===================================================================
--- trunk/doc/api/cplusplus/examples/example_dep_tree.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/doc/api/cplusplus/examples/example_dep_tree.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -98,7 +98,8 @@
                  * 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 @@
                  * 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;
                 }
 

Modified: trunk/paludis/args/dep_list_args_group.cc
===================================================================
--- trunk/paludis/args/dep_list_args_group.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/args/dep_list_args_group.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -256,7 +256,7 @@
                 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));
             }

Modified: trunk/paludis/dep_list.cc
===================================================================
--- trunk/paludis/dep_list.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/dep_list.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -371,7 +371,7 @@
 
         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 @@
 
             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 @@
         }
         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 @@
     {
         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 @@
          * 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 @@
                     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 @@
 
     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 @@
         }
     }
 
-    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 @@
                 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 @@
             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 @@
             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() << ")";
         }
     }
 }

Modified: trunk/paludis/dep_spec_flattener.cc
===================================================================
--- trunk/paludis/dep_spec_flattener.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/dep_spec_flattener.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -126,13 +126,13 @@
 
     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;
     }
 

Modified: trunk/paludis/environment_implementation.cc
===================================================================
--- trunk/paludis/environment_implementation.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environment_implementation.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -92,7 +92,7 @@
         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 @@
     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 @@
         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 @@
     }
 
     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;
 }
 

Modified: trunk/paludis/environments/no_config/no_config_environment.cc
===================================================================
--- trunk/paludis/environments/no_config/no_config_environment.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/no_config/no_config_environment.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -92,7 +92,8 @@
 
         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 @@
 
                 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 @@
         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 @@
     }
     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)

Modified: trunk/paludis/environments/paludis/bashable_conf.cc
===================================================================
--- trunk/paludis/environments/paludis/bashable_conf.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/bashable_conf.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -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 @@
 
         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();
         }
     }

Modified: trunk/paludis/environments/paludis/keywords_conf.cc
===================================================================
--- trunk/paludis/environments/paludis/keywords_conf.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/keywords_conf.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -99,7 +99,8 @@
 
         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 @@
                 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)));

Modified: trunk/paludis/environments/paludis/licenses_conf.cc
===================================================================
--- trunk/paludis/environments/paludis/licenses_conf.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/licenses_conf.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -98,7 +98,8 @@
 
         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 @@
                 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)));

Modified: trunk/paludis/environments/paludis/package_mask_conf.cc
===================================================================
--- trunk/paludis/environments/paludis/package_mask_conf.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/package_mask_conf.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -111,7 +111,7 @@
                 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)));

Modified: trunk/paludis/environments/paludis/paludis_config.cc
===================================================================
--- trunk/paludis/environments/paludis/paludis_config.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/paludis_config.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -166,26 +166,20 @@
 
             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 @@
         }
 
         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 @@
         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 @@
         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 @@
                 .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 @@
     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 @@
             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 @@
 
                 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 @@
 
             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 @@
             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 @@
             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 @@
     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;
 }

Modified: trunk/paludis/environments/paludis/paludis_environment.cc
===================================================================
--- trunk/paludis/environments/paludis/paludis_environment.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/paludis_environment.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -97,19 +97,19 @@
             {
                 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 @@
             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 @@
     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;
     }

Modified: trunk/paludis/environments/paludis/use_conf.cc
===================================================================
--- trunk/paludis/environments/paludis/use_conf.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/use_conf.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -101,7 +101,8 @@
 
         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 @@
 
             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 @@
             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 @@
                 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)));

Modified: trunk/paludis/environments/paludis/world.cc
===================================================================
--- trunk/paludis/environments/paludis/world.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/paludis/world.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -89,7 +89,8 @@
 
     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 @@
         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 @@
 
     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 @@
             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>(

Modified: trunk/paludis/environments/portage/portage_environment.cc
===================================================================
--- trunk/paludis/environments/portage/portage_environment.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/environments/portage/portage_environment.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -117,19 +117,19 @@
             {
                 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 @@
 
     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 @@
     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 @@
             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 @@
         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 @@
         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)));

Modified: trunk/paludis/hooker.cc
===================================================================
--- trunk/paludis/hooker.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/hooker.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -150,8 +150,8 @@
 {
     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 @@
         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 @@
 {
     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 @@
         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 @@
 {
     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 @@
     {
         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 @@
     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 @@
 
     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 @@
             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 @@
                 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 @@
                 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 @@
     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 @@
                             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 @@
             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 @@
                             }
                             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 @@
                     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 @@
         }
         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 @@
     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 @@
                                     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 @@
                         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 @@
                     {
                         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 @@
                                     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 << "'";
                         }
                     }

Modified: trunk/paludis/install_task.cc
===================================================================
--- trunk/paludis/install_task.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/install_task.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -403,7 +403,7 @@
 
     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 @@
 
             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 @@
 
             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;
             }
 

Modified: trunk/paludis/merger.cc
===================================================================
--- trunk/paludis/merger.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/merger.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -109,8 +109,8 @@
                          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 @@
                          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 @@
     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 @@
                         .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 @@
                         .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 @@
                         .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 @@
                          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 @@
                 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 @@
                          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 @@
     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 @@
                          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 @@
     }
     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 @@
                          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 @@
                          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 @@
                 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 @@
                          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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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

Modified: trunk/paludis/name.cc
===================================================================
--- trunk/paludis/name.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/name.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -431,8 +431,8 @@
                 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;

Modified: trunk/paludis/ndbam.cc
===================================================================
--- trunk/paludis/ndbam.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/ndbam.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -162,8 +162,8 @@
             }
             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 @@
             }
             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 @@
                 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 @@
             }
             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 @@
     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 @@
             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 @@
                     ++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 @@
                 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 @@
             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 @@
 
         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 @@
 
         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 @@
         {
             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 @@
 
             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 @@
         {
             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 @@
 
             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 @@
             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 @@
                 }
                 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() << ")";
                 }
             }

Modified: trunk/paludis/ndbam_merger.cc
===================================================================
--- trunk/paludis/ndbam_merger.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/ndbam_merger.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -210,7 +210,7 @@
 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

Modified: trunk/paludis/ndbam_unmerger.cc
===================================================================
--- trunk/paludis/ndbam_unmerger.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/ndbam_unmerger.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -226,8 +226,8 @@
         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)

Modified: trunk/paludis/package_database.cc
===================================================================
--- trunk/paludis/package_database.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/package_database.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -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 @@
                     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()), "', '") << "')";

Modified: trunk/paludis/python_hooks.cc
===================================================================
--- trunk/paludis/python_hooks.cc	2008-04-16 06:54:17 UTC (rev 4568)
+++ trunk/paludis/python_hooks.cc	2008-04-16 14:01:13 UTC (rev 4569)
@@ -119,14 +119,15 @@
         }
         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 @@
     }
     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 @@
     {
         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 @@
 
     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 @@
     }
     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 @@
         {
             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 @@
     {
         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 @@
     }
     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 @@
             }
             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 @@
         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";
     }