diff --git a/Source/Editor/Cooker/CookingData.h b/Source/Editor/Cooker/CookingData.h index 95d508509..51a3fcd79 100644 --- a/Source/Editor/Cooker/CookingData.h +++ b/Source/Editor/Cooker/CookingData.h @@ -409,17 +409,15 @@ public: public: - void Error(const String& msg); + void Error(const StringView& msg); + + void Error(const String& msg) + { + Error(StringView(msg)); + } void Error(const Char* msg) { - Error(String(msg)); - } - - template - void Error(const Char* format, const Args& ... args) - { - const String msg = String::Format(format, args...); - Error(msg); + Error(StringView(msg)); } }; diff --git a/Source/Editor/Cooker/GameCooker.cpp b/Source/Editor/Cooker/GameCooker.cpp index 91a3a5827..52550128e 100644 --- a/Source/Editor/Cooker/GameCooker.cpp +++ b/Source/Editor/Cooker/GameCooker.cpp @@ -343,7 +343,7 @@ void CookingData::AddRootEngineAsset(const String& internalPath) } } -void CookingData::Error(const String& msg) +void CookingData::Error(const StringView& msg) { LOG_STR(Error, msg); } diff --git a/Source/Editor/Cooker/Platform/Android/AndroidPlatformTools.cpp b/Source/Editor/Cooker/Platform/Android/AndroidPlatformTools.cpp index dda674c66..4c42699d6 100644 --- a/Source/Editor/Cooker/Platform/Android/AndroidPlatformTools.cpp +++ b/Source/Editor/Cooker/Platform/Android/AndroidPlatformTools.cpp @@ -314,7 +314,7 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data) const int32 result = Platform::CreateProcess(procSettings); if (result != 0) { - data.Error(TEXT("Failed to build Gradle project into package (result code: {0}). See log for more info."), result); + data.Error(String::Format(TEXT("Failed to build Gradle project into package (result code: {0}). See log for more info."), result)); return true; } diff --git a/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp index e28a711ac..d9a052419 100644 --- a/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp +++ b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp @@ -52,7 +52,7 @@ bool GDKPlatformTools::OnDeployBinaries(CookingData& data) files.Add(binPath / executableFilename); if (!FileSystem::FileExists(files[0])) { - data.Error(TEXT("Missing executable file ({0})."), files[0]); + data.Error(String::Format(TEXT("Missing executable file ({0})."), files[0])); return true; } FileSystem::DirectoryGetFiles(files, binPath, TEXT("*.dll"), DirectorySearchOption::TopDirectoryOnly); @@ -60,7 +60,7 @@ bool GDKPlatformTools::OnDeployBinaries(CookingData& data) { if (FileSystem::CopyFile(data.NativeCodeOutputPath / StringUtils::GetFileName(files[i]), files[i])) { - data.Error(TEXT("Failed to setup output directory (file {0})."), files[i]); + data.Error(String::Format(TEXT("Failed to setup output directory (file {0})."), files[i])); return true; } } diff --git a/Source/Editor/Cooker/Platform/UWP/UWPPlatformTools.cpp b/Source/Editor/Cooker/Platform/UWP/UWPPlatformTools.cpp index d493c5b0b..f6af5bb5a 100644 --- a/Source/Editor/Cooker/Platform/UWP/UWPPlatformTools.cpp +++ b/Source/Editor/Cooker/Platform/UWP/UWPPlatformTools.cpp @@ -65,7 +65,7 @@ bool UWPPlatformTools::OnDeployBinaries(CookingData& data) { if (!FileSystem::FileExists(files[i])) { - data.Error(TEXT("Missing source file {0}."), files[i]); + data.Error(String::Format(TEXT("Missing source file {0}."), files[i])); return true; } diff --git a/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp b/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp index 6a8408df5..361e5f937 100644 --- a/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp +++ b/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp @@ -129,7 +129,7 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c continue; if (FileSystem::CopyFile(dst, file)) { - data.Error(TEXT("Failed to copy file from {0} to {1}."), file, dst); + data.Error(String::Format(TEXT("Failed to copy file from {0} to {1}."), file, dst)); return true; } diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp index 687535b9b..4d4ea5e07 100644 --- a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp +++ b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp @@ -410,7 +410,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass assetBase->InitCompilationOptions(options); \ if (ShadersCompilation::Compile(options)) \ { \ - data.Data.Error(TEXT("Failed to compile shader '{0}' (profile: {1})."), asset->ToString(), ::ToString(options.Profile)); \ + data.Data.Error(String::Format(TEXT("Failed to compile shader '{0}' (profile: {1})."), asset->ToString(), ::ToString(options.Profile))); \ return true; \ } \ includes.Clear(); \ diff --git a/Source/Engine/Core/Log.h b/Source/Engine/Core/Log.h index de4dc108d..a7e927612 100644 --- a/Source/Engine/Core/Log.h +++ b/Source/Engine/Core/Log.h @@ -13,7 +13,7 @@ /// /// Sends a formatted message to the log file (message type - describes level of the log (see LogType enum)) /// -#define LOG(messageType, format, ...) Log::Logger::Write(LogType::messageType, TEXT(format), ##__VA_ARGS__) +#define LOG(messageType, format, ...) Log::Logger::Write(LogType::messageType, ::String::Format(TEXT(format), ##__VA_ARGS__)) /// /// Sends a string message to the log file (message type - describes level of the log (see LogType enum))