The proper way of accessing current function name is using __FUNCTION__ identifier. To use it as an FString and avoid compilation errors on different platforms (looking at you PS5) you need to wrap it with either:
ANSI_TO_TCHAR(__FUNCTION__)or with
StringCast<TCHAR>(__FUNCTION__).Get()(not an option in UE4 AFAIK)
Your logs should look like this then:
UE_LOG(
LogTemp,
Error,
TEXT("[%s] Error details"),
*StringCast<TCHAR>(__FUNCTION__).Get());
