diff --git a/src/tasks/WasmAppBuilder/EmccCompile.cs b/src/tasks/WasmAppBuilder/EmccCompile.cs index cec8460e6251f..c09633303da20 100644 --- a/src/tasks/WasmAppBuilder/EmccCompile.cs +++ b/src/tasks/WasmAppBuilder/EmccCompile.cs @@ -244,7 +244,7 @@ ITaskItem CreateOutputItemFor(string srcFile, string objFile) } } - private bool ShouldCompile(string srcFile, string objFile, string[] depFiles, out string reason) + private static bool ShouldCompile(string srcFile, string objFile, string[] depFiles, out string reason) { if (!File.Exists(srcFile)) throw new LogAsErrorException($"Could not find source file {srcFile}"); @@ -271,8 +271,7 @@ bool IsNewerThanOutput(string inFile, string outFile, out string reason) { if (!File.Exists(inFile)) { - reason = $"Could not find dependency file {inFile} needed for compiling {srcFile} to {outFile}"; - Log.LogWarning(reason); + reason = $"the dependency file {inFile} needed for compiling {srcFile} to {outFile} could not be found."; return true; } diff --git a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs index c40b6b4c6ec20..7f6062d8da777 100644 --- a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs @@ -204,7 +204,7 @@ private void ProcessType(Type type) } catch (NotImplementedException nie) { - Log.LogWarning($"Failed to generate icall function for method '[{method.DeclaringType!.Assembly.GetName().Name}] {className}::{method.Name}'" + + Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Failed to generate icall function for method '[{method.DeclaringType!.Assembly.GetName().Name}] {className}::{method.Name}'" + $" because type '{nie.Message}' is not supported for parameter named '{par.Name}'. Ignoring."); return null; } diff --git a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs index 74349b38166dd..ad2e43772cf8e 100644 --- a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs @@ -210,7 +210,7 @@ private void EmitPInvokeTable(StreamWriter w, Dictionary modules string imports = string.Join(Environment.NewLine, candidates.Select( p => $" {p.Method} (in [{p.Method.DeclaringType?.Assembly.GetName().Name}] {p.Method.DeclaringType})")); - Log.LogWarning($"Found a native function ({first.EntryPoint}) with varargs in {first.Module}." + + Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Found a native function ({first.EntryPoint}) with varargs in {first.Module}." + " Calling such functions is not supported, and will fail at runtime." + $" Managed DllImports: {Environment.NewLine}{imports}"); diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index c45a413ef53e6..2fead7b9860bf 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -253,7 +253,7 @@ private bool ExecuteInternal () string fullPath = assembly.GetMetadata("Identity"); if (string.IsNullOrEmpty(culture)) { - Log.LogWarning($"Missing CultureName metadata for satellite assembly {fullPath}"); + Log.LogWarning(null, "WASM0002", "", "", 0, 0, 0, 0, $"Missing CultureName metadata for satellite assembly {fullPath}"); continue; } // FIXME: validate the culture? @@ -290,7 +290,7 @@ private bool ExecuteInternal () if (firstPath == secondPath) { - Log.LogWarning($"Found identical vfs mappings for target path: {targetPath}, source file: {firstPath}. Ignoring."); + Log.LogWarning(null, "WASM0003", "", "", 0, 0, 0, 0, $"Found identical vfs mappings for target path: {targetPath}, source file: {firstPath}. Ignoring."); continue; } diff --git a/src/tasks/WasmAppBuilder/WasmLoadAssembliesAndReferences.cs b/src/tasks/WasmAppBuilder/WasmLoadAssembliesAndReferences.cs index de765e54093ae..e124835b45a99 100644 --- a/src/tasks/WasmAppBuilder/WasmLoadAssembliesAndReferences.cs +++ b/src/tasks/WasmAppBuilder/WasmLoadAssembliesAndReferences.cs @@ -76,7 +76,7 @@ private bool AddAssemblyAndReferences(MetadataLoadContext mlc, Assembly assembly { if (SkipMissingAssemblies) { - Log.LogWarning($"Loading assembly reference '{aname}' for '{assembly.GetName()}' failed: {ex.Message} Skipping."); + Log.LogWarning(null, "WASM0004", "", "", 0, 0, 0, 0, $"Loading assembly reference '{aname}' for '{assembly.GetName()}' failed: {ex.Message} Skipping."); } else {