Ignore:
Timestamp:
Mar 18, 2010, 11:33:54 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
6acc8e4
Parents:
f87c2a
git-author:
Frederik Heber <heber@…> (03/18/10 10:26:55)
git-committer:
Frederik Heber <heber@…> (03/18/10 11:33:54)
Message:

Log() and eLog() are prepended by a DoLog()/DoeLog() construct.

  • Most of the run time (95%) is spent on verbosity that it is discarded anyway due to a low verbosity setting. However, the operator << is evaluated from the right-hand side, hence the whole message is constructed and then thrown away.
  • DoLog() and DoeLog() are new functions that check the verbosity beforehand and are used as follows: DoLog(2) && (Log() << verbose(2) << "message" << endl);

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/logunittest.cpp

    rf87c2a r12f57b  
    4343
    4444  Log() << Verbose(0) << "Output a log message." << endl;
    45   eLog() << Verbose(0) << "Output an error message." << endl;
     45  DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl);
    4646  setVerbosity(3);
    4747  Log() << Verbose(4) << "This should not be printed." << endl;
    48   eLog() << Verbose(4) << "This should not be printed." << endl;
     48  DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl);
    4949};
    5050
Note: See TracChangeset for help on using the changeset viewer.