Changeset 96d8dc for molecuilder/src


Ignore:
Timestamp:
Oct 30, 2009, 11:04:50 AM (16 years ago)
Author:
Saskia Metzler <metzler@…>
Children:
ec70ec
Parents:
57cfb7
Message:

Ticket 43 Create a logging class

The verbosity level can now be handeled globally by setVerbosity().

Location:
molecuilder/src
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/Makefile.am

    r57cfb7 r96d8dc  
    11INCLUDES = -I$(top_srcdir)/src
    22
    3 noinst_PROGRAMS =  ActOnAllUnitTest AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest MemoryAllocatorUnitTest MemoryUsageObserverUnitTest VectorUnitTest
     3noinst_PROGRAMS =  ActOnAllUnitTest AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest LogUnitTest MemoryAllocatorUnitTest MemoryUsageObserverUnitTest VectorUnitTest
    44
    55TESTS = ActOnAllUnitTest AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest VectorUnitTest
     
    4040MemoryUsageObserverUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    4141MemoryUsageObserverUnitTest_LDADD = ../libmolecuilder.a
     42
     43LogUnitTest_SOURCES = ../errorLogger.cpp ../errorLogger.hpp ../log.cpp ../log.hpp ../logger.cpp ../logger.hpp logunittest.cpp logunittest.hpp
     44LogUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
     45LogUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     46LogUnitTest_LDADD = ../libmolecuilder.a
  • molecuilder/src/verbose.cpp

    r57cfb7 r96d8dc  
    1515};
    1616
     17/** States whether current output message should be print or not.
     18 * Compares Verbose::Verbosity against \a verbosityLevel.
     19 * \param verbosityLevel given global level of verbosity
     20 * \return true - do output, false - don't
     21 */
     22bool Verbose::DoOutput(int verbosityLevel) const
     23{
     24  return (verbosityLevel >= Verbosity);
     25};
     26
     27
    1728/** Operator for the Verbose(arg) call.
    1829 * Constructs temporary a Verbose class object, wherein the verbosity is stored.
     
    2637  return m.print(ost);
    2738};
    28 
    2939
    3040/** Prints the tabs according to verbosity stored in the temporary constructed class.
  • molecuilder/src/verbose.hpp

    r57cfb7 r96d8dc  
    3030
    3131    ostream& print (ostream &ost) const;
     32    bool DoOutput(int verbosityLevel) const;
    3233  private:
    3334    int Verbosity;
Note: See TracChangeset for help on using the changeset viewer.