diff --git a/Source/UniversalLogging/Public/IUniversalLogging.h b/Source/UniversalLogging/Public/IUniversalLogging.h index f65c4da7024e7670a4c82b251b2a25c12aa8cdd1..05af368cea83ba8b3a59e6574c3aa312fce3dfc5 100644 --- a/Source/UniversalLogging/Public/IUniversalLogging.h +++ b/Source/UniversalLogging/Public/IUniversalLogging.h @@ -71,10 +71,12 @@ public: * Advanced logging with printf like syntax. * Note: Does not automatically add newline! */ - template<typename... TArgs> - void LogF(const FString Stream, const FString Format, TArgs&&... Args) + template<typename FmtType, typename... TArgs> + void LogF(const FString Stream, const FmtType& Format, TArgs&&... Args) { - const FString Out = FString::Printf(*Format, Args...); + static_assert(TIsArrayOrRefOfType<FmtType, TCHAR>::Value, "Format must be a TCHAR string literal, i.e., only ever call this function with TEXT(\"...\") as the second parameter."); + + const FString Out = FString::Printf(Format, Args...); Log(Out, Stream, true); } };