always log from LOG_EVERY_MS if interval is <= 0
authorNathan Bronson <ngbronson@fb.com>
Thu, 31 Jul 2014 06:08:17 +0000 (23:08 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 14 Aug 2014 18:49:04 +0000 (11:49 -0700)
commitf13e9e39511d80132d10871ab1c916c2df5fd7db
tree04cbca17632e47d2e61cbf806a69067ec5ac0711
parente3e6edad974fe6a418ed7a503fa904a4052bd65d
always log from LOG_EVERY_MS if interval is <= 0

Summary:
This diff changes LOG_EVERY_MS so that if the specified
interval is zero or negative, no clock call is made and LOG(severity) is
always called.  milli_interval is copied into a temporary to avoid
double-evaluation.

Test Plan:
1. unit tests
2. new unit test

Reviewed By: lesha@fb.com

FB internal diff: D1469366

Tasks: 4813858
folly/Logging.h
folly/test/LoggingTest.cpp