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, Candidate_v1.7.1, 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/datacreator.cpp

    r50e4e5 r47d041  
    5151  output.open(name.str().c_str(), ios::out);
    5252  if (output == NULL) {
    53     DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl);
     53    LOG(0, "Unable to open " << name.str() << " for writing, is directory correct?");
    5454    return false;
    5555  }
     
    6969  output.open(name.str().c_str(), ios::app);
    7070  if (output == NULL) {
    71     DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl);
     71    LOG(0, "Unable to open " << name.str() << " for writing, is directory correct?");
    7272    return false;
    7373  }
     
    8989  filename << prefix << ".dat";
    9090  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    91   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     91  LOG(0, msg);
    9292  output << "# " << msg << ", created on " << datum;
    9393  output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    122122  filename << prefix << ".dat";
    123123  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    124   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     124  LOG(0, msg);
    125125  output << "# " << msg << ", created on " << datum;
    126126  output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    159159  filename << prefix << ".dat";
    160160  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    161   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     161  LOG(0, msg);
    162162  output << "# " << msg << ", created on " << datum;
    163163  output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    191191  filename << prefix << ".dat";
    192192  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    193   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     193  LOG(0, msg);
    194194  output << "# " << msg << ", created on " << datum;
    195195  output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    224224  filename << prefix << ".dat";
    225225  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    226   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     226  LOG(0, msg);
    227227  output << "# " << msg << ", created on " << datum;
    228228  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
    229229  Fragments.SetLastMatrix(Force.Matrix[Force.MatrixCounter], 0);
    230230  for (int BondOrder=0;BondOrder<KeySets.Order;BondOrder++) {
    231     //Log() << Verbose(0) << "Current order is " << BondOrder << "." << endl;
     231    //LOG(0, "Current order is " << BondOrder << ".");
    232232    Fragments.SumSubForces(Fragments, KeySets, BondOrder, -1.);
    233233    // errors per atom
     
    270270  filename << prefix << ".dat";
    271271  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    272   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     272  LOG(0, msg);
    273273  output << "# " << msg << ", created on " << datum;
    274274  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
    275275  for (int BondOrder=0;BondOrder<KeySets.Order;BondOrder++) {
    276     //Log() << Verbose(0) << "Current order is " << BondOrder << "." << endl;
     276    //LOG(0, "Current order is " << BondOrder << ".");
    277277    Fragments.SumSubForces(Fragments, KeySets, BondOrder, 1.);
    278278    // errors per atom
     
    307307  filename << prefix << ".dat";
    308308  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    309   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     309  LOG(0, msg);
    310310  output << "# " << msg << ", created on " << datum;
    311311  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
    312312  Fragments.SetLastMatrix(Hessian.Matrix[Hessian.MatrixCounter], 0);
    313313  for (int BondOrder=0;BondOrder<KeySets.Order;BondOrder++) {
    314     //Log() << Verbose(0) << "Current order is " << BondOrder << "." << endl;
     314    //LOG(0, "Current order is " << BondOrder << ".");
    315315    Fragments.SumSubHessians(Fragments, KeySets, BondOrder, -1.);
    316316    // errors per atom
     
    347347  filename << prefix << ".dat";
    348348  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    349   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     349  LOG(0, msg);
    350350  output << "# " << msg << ", created on " << datum;
    351351  output << "# AtomNo\t";
     
    357357  output << Fragments.RowCounter[ Fragments.MatrixCounter ] << "\t";
    358358  for (int BondOrder=0;BondOrder<KeySets.Order;BondOrder++) {
    359     //Log() << Verbose(0) << "Current order is " << BondOrder << "." << endl;
     359    //LOG(0, "Current order is " << BondOrder << ".");
    360360    Fragments.SumSubHessians(Fragments, KeySets, BondOrder, -1.);
    361361    // frobenius norm of errors per atom
     
    389389  filename << prefix << ".dat";
    390390  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    391   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     391  LOG(0, msg);
    392392  output << "# " << msg << ", created on " << datum;
    393393  output << "# AtomNo\t" << Fragments.Header[ Fragments.MatrixCounter ] << endl;
    394394  Fragments.SetLastMatrix(0., 0);
    395395  for (int BondOrder=0;BondOrder<KeySets.Order;BondOrder++) {
    396     //Log() << Verbose(0) << "Current order is " << BondOrder << "." << endl;
     396    //LOG(0, "Current order is " << BondOrder << ".");
    397397    Fragments.SumSubHessians(Fragments, KeySets, BondOrder, 1.);
    398398    // errors per atom
     
    419419  filename << prefix << ".dat";
    420420  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    421   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     421  LOG(0, msg);
    422422  output << "# " << msg << ", created on " << datum << endl;
    423423  output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl;
     
    484484  filename << prefix << ".dat";
    485485  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    486   DoLog(0) && (Log() << Verbose(0) << msg << endl);
     486  LOG(0, msg);
    487487  output << "# " << msg << ", created on " << datum;
    488488  output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl;
Note: See TracChangeset for help on using the changeset viewer.