From 284490f2719d192eced75f2be4f356e69ff410d5 Mon Sep 17 00:00:00 2001 From: elvez Date: Fri, 8 Sep 2006 10:11:02 +0000 Subject: [PATCH] - Reduced verbosity of PythonPolicyManager`s policies collection process git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1060 3ecf2c5c-341e-0410-92b4-d18e462d057c --- .../pyloader/src/python_cpu_policy_manager.cc | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/pyloader/src/python_cpu_policy_manager.cc b/plugins/pyloader/src/python_cpu_policy_manager.cc index caf0a83..ef06b2d 100644 --- a/plugins/pyloader/src/python_cpu_policy_manager.cc +++ b/plugins/pyloader/src/python_cpu_policy_manager.cc @@ -110,18 +110,20 @@ PythonCPUPolicyManager::collect_policies() { Glib::Dir dir(dir_it->c_str()); - cout << "Opening directory " << *dir_it << " looking for python policies..." << endl; +#ifndef NDEBUG + std::clog << "Opening directory " << *dir_it << " looking for python policies..." << endl; +#endif for (Glib::DirIterator file_it = dir.begin(); file_it != dir.end(); ++file_it) { - cout << "\tChecking if " << *file_it << " is a valid Python script... "; Glib::PatternSpec dot_py("*.py"); if (dot_py.match(*file_it)) { - cout << "yes" << endl; - +#ifndef NDEBUG + std::clog << "\t" << *file_it << " is a valid Python script. Attempting to load... "; +#endif //strip extension std::string policy_name = (*file_it).substr(0, (*file_it).size() - 3); @@ -130,14 +132,16 @@ PythonCPUPolicyManager::collect_policies() PythonCPUPolicy *pypolicy = new PythonCPUPolicy(policy_name.c_str()); _policies.push_back(pypolicy); + +#ifndef NDEBUG + std::clog << "OK\n"; +#endif } - catch (MalformedPolicyException e) + catch (const MalformedPolicyException& e) { - std::cerr << "POLICY LOAD ERROR: " << e.what() << endl; + std::clog << "POLICY LOAD ERROR: " << e.what() << endl; } } - else - cout << "no" << endl; } } }