diff --git a/modules/conop/pymod/export_processor.cc b/modules/conop/pymod/export_processor.cc index c9298c25de569fd882a28fbf1bf949739581be03..b051c78ab5e8b7861b7ebcee0259b73de04c88e2 100644 --- a/modules/conop/pymod/export_processor.cc +++ b/modules/conop/pymod/export_processor.cc @@ -67,7 +67,8 @@ void export_processor() { &Processor::SetUnkResidueTreatment) .add_property("unk_atom_treatment", &Processor::GetUnkAtomTreatment, &Processor::SetUnkAtomTreatment) - .def("Process", &Processor::Process) + .def("Process", &Processor::Process, + (arg("ent"), arg("log_diags")=true)) ; class_<PyProcessor, boost::noncopyable, boost::shared_ptr<WrappedProcessor>, diff --git a/modules/conop/src/processor.cc b/modules/conop/src/processor.cc index 1e996b77ab0aeb8a7437eb55e91c2ea069106ce9..57dbddc419dbbc0c7dc5f454912bbe3409ea6a31 100644 --- a/modules/conop/src/processor.cc +++ b/modules/conop/src/processor.cc @@ -16,6 +16,7 @@ // along with this library; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA //------------------------------------------------------------------------------ +#include <ost/log.hh> #include <ost/mol/xcs_editor.hh> #include <ost/mol/bond_handle.hh> #include <ost/mol/torsion_handle.hh> @@ -23,7 +24,8 @@ namespace ost { namespace conop { -DiagnosticsPtr Processor::Process(mol::EntityHandle ent) const +DiagnosticsPtr Processor::Process(mol::EntityHandle ent, + bool log_diags) const { DiagnosticsPtr diags(new Diagnostics); if (!this->BeginProcessing(diags, ent)) { @@ -32,6 +34,12 @@ DiagnosticsPtr Processor::Process(mol::EntityHandle ent) const this->DoProcess(diags, ent); this->EndProcessing(diags, ent); + if (log_diags) { + for (Diagnostics::diag_iterator i = diags->diags_begin(), + e = diags->diags_end(); i != e; ++i) { + LOG_WARNING((*i)->Format(false)); + } + } return diags; } diff --git a/modules/conop/src/processor.hh b/modules/conop/src/processor.hh index 79406e72e6803109855b90eb3c90b4189ae8cce1..a63a5105f5cd549d8d8ac0584834b757c4d2fdeb 100644 --- a/modules/conop/src/processor.hh +++ b/modules/conop/src/processor.hh @@ -44,7 +44,7 @@ typedef boost::shared_ptr<Processor> ProcessorPtr; // the base class for all options class DLLEXPORT_OST_CONOP Processor { public: - DiagnosticsPtr Process(mol::EntityHandle ent) const; + DiagnosticsPtr Process(mol::EntityHandle ent, bool log_diags=true) const; virtual ProcessorPtr Copy() const = 0; protected: virtual void DoProcess(DiagnosticsPtr diags,