Changeset 89f768


Ignore:
Timestamp:
Nov 10, 2009, 8:53:33 PM (15 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:
36eb4e
Parents:
9a7186
Message:

BUGFIX: Output is again indented, errorLogger prefixes according to verbosity.

  • BUGFIX: as "(logger << verbose) = cout" was evaluated, this did not translate to (cout << verbose). Hence, the tabbing was lost. This is fixed.
  • errorLogger::operator << : 0 - CRITICL, 1 - ERROR, 2, ... - WARNING
  • in class Verbose the logger::operator functions are declared friend to allow access to Verbose::verbosity
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/errorlogger.cpp

    r9a7186 r89f768  
    8181  int verbosityLevel = l.verbosity;
    8282  l.nix->clear();
    83   if (v.DoOutput(verbosityLevel))
     83  if (v.DoOutput(verbosityLevel)) {
     84    v.print(cout);
     85    switch(v.Verbosity) {
     86      case 0:
     87        cout << "CRITICAL: ";
     88        break;
     89      case 1:
     90        cout << "ERROR: ";
     91        break;
     92      case 2:
     93        cout << "WARNING: ";
     94        break;
     95      default:
     96        break;
     97    }
    8498    return cerr;
    85   else
     99  } else
    86100    return *l.nix;
    87101};
     
    90104  int verbosityLevel = l->verbosity;
    91105  l->nix->clear();
    92   if (v.DoOutput(verbosityLevel))
     106  if (v.DoOutput(verbosityLevel)) {
     107    v.print(cout);
     108    switch(v.Verbosity) {
     109      case 0:
     110        cout << "CRITICAL: ";
     111        break;
     112      case 1:
     113        cout << "ERROR: ";
     114        break;
     115      case 2:
     116        cout << "WARNING: ";
     117        break;
     118      default:
     119        break;
     120    }
    93121    return cerr;
    94   else
     122  } else
    95123    return *l->nix;
    96124};
  • src/logger.cpp

    r9a7186 r89f768  
    8181  int verbosityLevel = l.verbosity;
    8282  l.nix->clear();
    83   if (v.DoOutput(verbosityLevel))
     83  if (v.DoOutput(verbosityLevel)) {
     84    v.print(cout);
    8485    return cout;
    85   else
     86  } else
    8687    return *l.nix;
    8788};
     
    9091  int verbosityLevel = l->verbosity;
    9192  l->nix->clear();
    92   if (v.DoOutput(verbosityLevel))
     93  if (v.DoOutput(verbosityLevel)) {
     94    v.print(cout);
    9395    return cout;
    94   else
     96  } else
    9597    return *l->nix;
    9698};
  • src/verbose.hpp

    r9a7186 r89f768  
    2929    Verbose(int value) : Verbosity(value) { }
    3030
     31    // allow access to private variable Verbose::Verbosity
     32    friend ostream& operator<<(class errorLogger& l, const Verbose& v);
     33    friend ostream& operator<<(class errorLogger* l, const Verbose& v);
     34    friend ostream& operator<<(class logger& l, const Verbose& v);
     35    friend ostream& operator<<(class logger* l, const Verbose& v);
     36
    3137    ostream& print (ostream &ost) const;
    3238    bool DoOutput(int verbosityLevel) const;
Note: See TracChangeset for help on using the changeset viewer.