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

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/KeySetsContainer.cpp

    r50e4e5 r47d041  
    6464
    6565  FragmentCounter = FCounter;
    66   DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl);
     66  LOG(0, "Parsing key sets.");
    6767  KeySets.resize(FragmentCounter);
    6868  file << name << FRAGMENTPREFIX << KEYSETFILE;
    6969  input.open(file.str().c_str(), ios::in);
    7070  if (input.fail()) {
    71     DoLog(0) && (Log() << Verbose(0) << endl << "KeySetsContainer::ParseKeySets: Unable to open " << file.str() << ", is the directory correct?" << endl);
     71    LOG(0, endl << "KeySetsContainer::ParseKeySets: Unable to open " << file.str() << ", is the directory correct?");
    7272    return false;
    7373  }
     
    8282      KeySets[i][j] = -1;
    8383    FragmentNumber = FixedDigitNumber(FragmentCounter, i);
    84     //Log() << Verbose(0) << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:";
     84    //std::stringstream output;
     85    //output << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:";
    8586    delete[](FragmentNumber);
    8687    input.getline(filename, 1023);
     
    8889    for(int j=0;(j<AtomCounter[i]) && (!line.eof());j++) {
    8990      line >> KeySets[i][j];
    90       //Log() << Verbose(0) << " " << KeySets[i][j];
     91      //output << " " << KeySets[i][j];
    9192    }
    92     //Log() << Verbose(0) << endl;
     93    //LOG(0, output.str());
    9394  }
    9495  input.close();
     
    103104  int Counter;
    104105
    105   DoLog(0) && (Log() << Verbose(0) << "Creating Fragment terms." << endl);
     106  LOG(0, "Creating Fragment terms.");
    106107  // scan through all to determine maximum order
    107108  Order=0;
     
    114115      Order = Counter;
    115116  }
    116   DoLog(0) && (Log() << Verbose(0) << "Found Order is " << Order << "." << endl);
     117  LOG(0, "Found Order is " << Order << ".");
    117118
    118119  // scan through all to determine fragments per order
     
    128129  }
    129130  for(int i=0;i<Order;i++)
    130     DoLog(0) && (Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl);
     131    LOG(0, "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << ".");
    131132
    132133  // scan through all to gather indices to each order set
     
    144145    FragmentsPerOrder[Counter-1]++;
    145146  }
    146   DoLog(0) && (Log() << Verbose(0) << "Printing OrderSet." << endl);
     147  std::stringstream output;
     148  output << "Printing OrderSet: " << std::endl;
    147149  for(int i=0;i<Order;i++) {
    148150    for (int j=0;j<FragmentsPerOrder[i];j++) {
    149       DoLog(0) && (Log() << Verbose(0) << " " << OrderSet[i][j]);
     151      output << " " << OrderSet[i][j];
    150152    }
    151     DoLog(0) && (Log() << Verbose(0) << endl);
    152   }
    153   DoLog(0) && (Log() << Verbose(0) << endl);
    154 
     153    output << std::endl;
     154  }
     155  LOG(0, output.str());
    155156
    156157  return true;
Note: See TracChangeset for help on using the changeset viewer.