Added  flag ENABLE_LOG_ALL to enable all logging