deepeshmalviya/scribe — comment on commit 53f581a2ba945db087181114bb49f1f5cdaaae03
File:  line 0
By deepeshmalviya:

Actually no, if you look into the code

line 380
bool rotate = ((currentSize > maxSize) && (maxSize != 0));

This is first rotation check which is based on size in which if the current size is greater than the max size configured it will rotate, if not the value of rotate will be false.

In case size check return false, the next lines 381-400 will be executed which is time based rolling

if (!rotate) {
switch (rollPeriod) {
case ROLL_DAILY:
rotate = timeinfo.tm_mday != lastRollTime &&
static_cast(timeinfo.tm_hour) >= rollHour &&
static_cast(timeinfo.tm_min) >= rollMinute;
break;
case ROLL_HOURLY:
rotate = timeinfo.tm_hour != lastRollTime &&
static_cast(timeinfo.tm_min) >= rollMinute;
break;
case ROLL_OTHER:
rotate = rawtime >= lastRollTime + rollPeriodLength;
break;
case ROLL_NEVER:
break;
}
// Do periodic roll up only if you have some messages

rotate = rotateIfData ? (currentSize > 0) : rotate;
}

In this piece of code, based on the roll period, the value of rotate is decided and the 0 bytes creation of files are due to time based rolling only.
Now in my line,
rotate = rotateIfData ? (currentSize > 0) : rotate;
after the rotate variable is decided by the roll period, the check will first validate that whether user wants to enable the rotateIfData and if yes, then the evaluation of currentSize is done. If the currentSize is greater than zero means it has some data in it, it will return true and will rotate the file. In case the currentSize is not greater than zero, currentSize > 0 condition will evaluate to false and disable the rotation and hence will prevent the 0 bytes file creation.
If rotateIfData configuration is not set by user, then anyway it will not evaluate and fall back to default scribe behavior.

Hope I was clear. Ping me back if you still have question.