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; } } }