log using ofstream instead of Win32 API