Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
41a467
Parents:
50e4e5
git-author:
Frederik Heber <heber@…> (10/27/11 11:53:58)
git-committer:
Frederik Heber <heber@…> (11/03/11 19:44:01)
Message:

HUGE: Removed all calls to Log(), eLog(), replaced by LOG() and ELOG().

  • Replaced DoLog(.) && (Log() << Verbose(.) << ... << std::endl) by Log(., ...).
  • Replaced Log() << Verbose(.) << .. << by Log(., ...)
  • on multiline used stringstream to generate and message which was finally used in LOG(., output.str())
  • there should be no more occurence of Log(). LOG() and ELOG() must be used instead.
  • Eventually, this will allow for storing all errors and re-printing them on program exit which would be very helpful to ascertain error-free runs for the user.
Location:
src/Actions/AtomAction
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/AddAction.cpp

    r50e4e5 r47d041  
    4848  first->setType(params.elemental);
    4949  first->setPosition(params.position);
    50   DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "." << endl);
     50  LOG(1, "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << ".");
    5151  // TODO: remove when all of World's atoms are stored.
    5252  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     
    6161  AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
    6262
    63   DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);
     63  LOG(1, "Removing atom with id " << state->id << ".");
    6464  World::getInstance().destroyAtom(state->id);
    6565
     
    7373  first->setType(state->params.elemental);
    7474  first->setPosition(state->params.position);
    75   DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->params.elemental->getName() << " at " << state->params.position << "." << endl);
     75  LOG(1, "Re-adding new atom with element " << state->params.elemental->getName() << " at " << state->params.position << ".");
    7676  // TODO: remove when all of World's atoms are stored.
    7777  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r50e4e5 r47d041  
    5757  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5858    first = iter->second;
    59     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << *params.elemental << "." << endl);
     59    LOG(1, "Changing atom " << *first << " to element " << *params.elemental << ".");
    6060    mol = first->getMolecule();
    6161    first->removeFromMolecule(); // remove atom
  • src/Actions/AtomAction/RemoveAction.cpp

    r50e4e5 r47d041  
    5353      iter != World::getInstance().endAtomSelection();
    5454      iter = World::getInstance().beginAtomSelection()) {
    55     DoLog(1) && (Log() << Verbose(1) << "Removing atom " << (iter->second)->getId() << "." << endl);
     55    LOG(1, "Removing atom " << (iter->second)->getId() << ".");
    5656    World::getInstance().destroyAtom((iter->second));
    5757  }
     
    6565  for (; i<state->Walkers.size(); ++i) {
    6666    // re-create the atom
    67     DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);
     67    LOG(1, "Re-adding atom " << state->Walkers[i].getId() << ".");
    6868    atom *Walker = World::getInstance().createAtom();
    6969    if (!state->Walkers[i].setAtom(*Walker)) {
    70       DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);
     70      ELOG(1, "Failed to set id.");
    7171      World::getInstance().destroyAtom(Walker);
    7272      break;
     
    8888  // simple remove again all previously added atoms
    8989  for (size_t i=0; i<state->Walkers.size(); ++i) {
    90     DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);
     90    LOG(1, "Re-removing atom " << state->Walkers[i].getId() << ".");
    9191    World::getInstance().destroyAtom(state->Walkers[i].getId());
    9292  }
  • src/Actions/AtomAction/RotateAroundOriginByAngleAction.cpp

    r50e4e5 r47d041  
    5656  Line RotationAxis(Vector(0.,0.,0.), params.Axis);
    5757
    58   DoLog(0) && (Log() << Verbose(0) << "Rotate around origin by " << params.angle << " radian, axis from origin to " << params.Axis << "." << endl);
     58  LOG(0, "Rotate around origin by " << params.angle << " radian, axis from origin to " << params.Axis << ".");
    5959  // TODO: use AtomSet::rotate?
    6060  for (std::vector<atom *>::iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) {
    6161    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle));
    6262  }
    63   DoLog(0) && (Log() << Verbose(0) << "done." << endl);
     63  LOG(0, "done.");
    6464  return Action::state_ptr(new AtomRotateAroundOriginByAngleState(World::getInstance().getSelectedAtoms(), params));
    6565}
  • src/Actions/AtomAction/SaveSelectedAtomsAction.cpp

    r50e4e5 r47d041  
    4141  getParametersfromValueStorage();
    4242
    43   DoLog(1) && (Log() << Verbose(1) << "Storing selected atoms to file " << params.filename << "." << endl);
     43  LOG(1, "Storing selected atoms to file " << params.filename << ".");
    4444
    4545  // extract suffix
     
    5656#endif
    5757  } else {
    58     DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl);
     58    ELOG(1, "Output file does not have a suffix, cannot recognize format.");
    5959    return Action::failure;
    6060  }
     
    6767    FormatParserStorage::getInstance().saveSelectedAtoms(output, FilenameSuffix);
    6868  } else {
    69     DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
     69    ELOG(1, "Could not open file " << params.filename << ".");
    7070  }
    7171  output.close();
Note: See TracChangeset for help on using the changeset viewer.