Do not call LOG_API without any parameter

Visual Studio does not allow to call LOG_API without any parameter.
Change DATADIR to CHEWING_DATADIR

DATADIR conflicts with Visual Studio header, so changing it to
CHEWING_DATADIR.
Move declaraion before any statement