Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (13 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, 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/UIElements/CommandLineUI
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    r50e4e5 r47d041  
    419419{
    420420  std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
    421   DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl);
     421  LOG(0, "Scanning command line arguments and recognizing Actions.");
    422422  // go through all arguments
    423423  for (int i=1;i<argc;i++) {
    424     DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl);
     424    LOG(2, "Checking on " << argv[i]);
    425425    // check whether they
    426426    if (argv[i][0] == '-') { // .. begin with -
    427       DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl);
     427      LOG(2, "Possible argument: " << argv[i]);
    428428      if (argv[i][1] == '-') { // .. or --
    429         DoLog(1) && (Log() << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
     429        LOG(1, "Putting " << argv[i] << " into the sequence.");
    430430        SequenceOfActions.push_back(&(argv[i][2]));
    431431        //  .. and check that next letter is not numeric, if so insert
     
    433433        std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    434434        if (iter != ShortFormToActionMap.end()) {
    435           DoLog(1) && (Log() << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
     435          LOG(1, "Putting " << iter->second << " for " << iter->first << " into the sequence.");
    436436          SequenceOfActions.push_back(iter->second);
    437437        }
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    r50e4e5 r47d041  
    5353
    5454  // go through all possible actions
    55   DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl);
     55  LOG(0, "Calling Actions ... ");
    5656  for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) {
    5757    if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) {
    58 //      DoLog(1) && (Log() << Verbose(1)
    59 //          << "Checking presence of " << *CommandRunner << ": "
    60 //          << "calling " << *CommandRunner << endl);
     58//      LOG1, "INFO: Checking presence of " << *CommandRunner << ": " << "calling " << *CommandRunner);
    6159      ActionRegistry::getInstance().getActionByName(*CommandRunner)->call();
    6260    } else {
    63 //      DoLog(1) && (Log() << Verbose(1)
    64 //          << "Checking presence of " << *CommandRunner << ": "
    65 //          << "absent." << endl);
     61//      LOG(1, "INFO: Checking presence of " << *CommandRunner << ": " << "absent.");
    6662    }
    6763  }
  • src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp

    r50e4e5 r47d041  
    4646    return true;
    4747  } else {
    48     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atom for " << getTitle() << "." << endl);
     48    ELOG(1, "CommandLineUI parsing error: Missing atom for " << getTitle() << ".");
    4949    return false;
    5050  }
  • src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp

    r50e4e5 r47d041  
    4545    return true;
    4646  } else {
    47     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atoms for " << getTitle() << "." << endl);
     47    ELOG(1, "CommandLineUI parsing error: Missing atoms for " << getTitle() << ".");
    4848    return false;
    4949  }
  • src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing boolean for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing boolean for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp

    r50e4e5 r47d041  
    4141    return true;
    4242  } else {
    43     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << "." << endl);
     43    ELOG(1, "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << ".");
    4444    return false;
    4545  }
  • src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp

    r50e4e5 r47d041  
    3737    return true;
    3838  } else {
    39     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing double for " << getTitle() << "." << endl);
     39    ELOG(1, "CommandLineUI parsing error: Missing double for " << getTitle() << ".");
    4040    return false;
    4141  }
  • src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing doubles for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing doubles for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp

    r50e4e5 r47d041  
    4444    return true;
    4545  } else {
    46     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing element for " << getTitle() << "." << endl);
     46    ELOG(1, "CommandLineUI parsing error: Missing element for " << getTitle() << ".");
    4747    return false;
    4848  }
  • src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp

    r50e4e5 r47d041  
    4747    return true;
    4848  } else {
    49     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing elements for " << getTitle() << "." << endl);
     49    ELOG(1, "CommandLineUI parsing error: Missing elements for " << getTitle() << ".");
    5050    return false;
    5151  }
  • src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing string for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing integer for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing integers for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp

    r50e4e5 r47d041  
    4141    return true;
    4242  } else {
    43     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecule for " << getTitle() << "." << endl);
     43    ELOG(1, "CommandLineUI parsing error: Missing molecule for " << getTitle() << ".");
    4444    return false;
    4545  }
  • src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp

    r50e4e5 r47d041  
    4646    return true;
    4747  } else {
    48     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecules for " << getTitle() << "." << endl);
     48    ELOG(1, "CommandLineUI parsing error: Missing molecules for " << getTitle() << ".");
    4949    return false;
    5050  }
  • src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp

    r50e4e5 r47d041  
    4141    std::string stringtext = CommandLineParser::getInstance().vm[getTitle()].as<std::string>();
    4242    std::stringstream text(stringtext);
    43 //    DoLog(1) && (Log() << Verbose(1) << "Parameter set from CommandLine is '"
    44 //        << text.str() << "'" << std::endl);
     43//    LOG(1, "INFO: Parameter set from CommandLine is '" << text.str() << "'");
    4544    text >> tmp;
    4645    return true;
    4746  } else {
    48     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing RandomNumberDistribution_Parameters for " << getTitle() << "." << endl);
     47    ELOG(1, "CommandLineUI parsing error: Missing RandomNumberDistribution_Parameters for " << getTitle() << ".");
    4948    return false;
    5049  }
  • src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing string for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing strings for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing strings for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing integer for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp

    r50e4e5 r47d041  
    3636    return true;
    3737  } else {
    38     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
     38    ELOG(1, "CommandLineUI parsing error: Missing integers for " << getTitle() << ".");
    3939    return false;
    4040  }
  • src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp

    r50e4e5 r47d041  
    4242    tmp = temp.toVector();
    4343    if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
    44       DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
     44      ELOG(1, "Vector " << tmp << " would be outside of box domain.");
    4545      return false;
    4646    }
    4747    return true;
    4848  } else {
    49     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vector for " << getTitle() << "." << endl);
     49    ELOG(1, "CommandLineUI parsing error: Missing vector for " << getTitle() << ".");
    5050    return false;
    5151  }
  • src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp

    r50e4e5 r47d041  
    4545        tmp.push_back(temp);
    4646      else
    47         DoeLog(1) && (eLog() << Verbose(1) << "Vector " << temp << " would be outside of box domain." << endl);
     47        ELOG(1, "Vector " << temp << " would be outside of box domain.");
    4848    }
    4949    return true;
    5050  } else {
    51     DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vectors for " << getTitle() << "." << endl);
     51    ELOG(1, "CommandLineUI parsing error: Missing vectors for " << getTitle() << ".");
    5252    return false;
    5353  }
Note: See TracChangeset for help on using the changeset viewer.