From 026b71db2b8f24d251fa24fee7497aec436593ed Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 19 Mar 2021 20:46:42 -0400 Subject: [PATCH] =?UTF-8?q?[wasm]=20Use=20`g=5Fprinterr`=20to=20emit=20err?= =?UTF-8?q?ors=20in=20mini-wasm.c,=20so=20they=20show=20up=20wit=E2=80=A6?= =?UTF-8?q?=20(#49838)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [wasm] Use g_error to emit errors in mini-wasm.c, so they show up with traces in js console * address review feedback vargaz: printf in JIT code is mapped to the platform logging operation, so this one can stay as it is. * Use g_printerr instead of g_error, as suggested by feedback --- src/mono/mono/mini/mini-wasm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/mini/mini-wasm.c b/src/mono/mono/mini/mini-wasm.c index f18d837f1b1..1f93181af3a 100644 --- a/src/mono/mono/mini/mini-wasm.c +++ b/src/mono/mono/mini/mini-wasm.c @@ -567,13 +567,13 @@ mono_set_timeout_exec (int id) //YES we swallow exceptions cuz there's nothing much we can do from here. //FIXME Maybe call the unhandled exception function? if (!is_ok (error)) { - printf ("timeout callback failed due to %s\n", mono_error_get_message (error)); + g_printerr ("timeout callback failed due to %s\n", mono_error_get_message (error)); mono_error_cleanup (error); } if (exc) { char *type_name = mono_type_get_full_name (mono_object_class (exc)); - printf ("timeout callback threw a %s\n", type_name); + g_printerr ("timeout callback threw a %s\n", type_name); g_free (type_name); } } @@ -605,13 +605,13 @@ tp_cb (void) mono_runtime_try_invoke (method, NULL, NULL, &exc, error); if (!is_ok (error)) { - printf ("ThreadPool Callback failed due to error: %s\n", mono_error_get_message (error)); + g_printerr ("ThreadPool Callback failed due to error: %s\n", mono_error_get_message (error)); mono_error_cleanup (error); } if (exc) { char *type_name = mono_type_get_full_name (mono_object_class (exc)); - printf ("ThreadPool Callback threw an unhandled exception of type %s\n", type_name); + g_printerr ("ThreadPool Callback threw an unhandled exception of type %s\n", type_name); g_free (type_name); } } -- GitLab