From: 최종헌/Common Platform Lab(SR)/Engineer/삼성전자 Date: Tue, 26 May 2020 21:34:47 +0000 (+0900) Subject: Show the warning log when preload skip (#230) X-Git-Tag: accepted/tizen/5.5/unified/20200528.043046~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=205d5118076265434cd51123d494e3e2fdca2d60;p=platform%2Fcore%2Fdotnet%2Flauncher.git Show the warning log when preload skip (#230) Change-Id: Ifd9a28c26cecbb996c9452db3bb57930e0311224 --- diff --git a/Managed/Tizen.Runtime/Preloader.cs b/Managed/Tizen.Runtime/Preloader.cs index f523fc1..f0ed99e 100644 --- a/Managed/Tizen.Runtime/Preloader.cs +++ b/Managed/Tizen.Runtime/Preloader.cs @@ -41,6 +41,7 @@ namespace Tizen.Runtime try { + Console.WriteLine("Start preload : " + fileName); BindingFlags bindingFlag = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; foreach (string line in File.ReadLines(path)) { @@ -63,40 +64,35 @@ namespace Tizen.Runtime typenameStr = typenameStr.Replace("." + methodStr + parenthesis, ""); } - try + if (assemblyStr == "" || typenameStr == "" || typenameStr.Contains(parenthesis)) { - if (assemblyStr == "") - continue; + Console.WriteLine("[Warning] Skip the '" + line + "' in " + fileName); + continue; + } + try + { Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(assemblyStr)); - if (asm == null || typenameStr == "") - continue; - Type type = asm.GetType(typenameStr); - if (type == null || methodStr == "") - continue; - - MethodInfo method = type.GetMethod(methodStr, bindingFlag); - if (method == null) - continue; + if (type == null) + Console.WriteLine("[Warning] Check the '" + line + "' in " + fileName); - method.Invoke(null, null); + if (methodStr != "") + { + MethodInfo method = type.GetMethod(methodStr, bindingFlag); + method.Invoke(null, null); + } } - catch (Exception e) + catch { - Console.WriteLine(e.ToString()); - Console.WriteLine("[ERROR] Failed to '" + line + "' preload"); + Console.WriteLine("[Error] Fail the '" + line + "' in " + fileName); } } } catch (IOException e) { Console.WriteLine(e.ToString()); - Console.WriteLine("[ERROR] Failed to " + path + " file open"); - } - finally - { - Console.WriteLine("Success to preload : " + fileName); + Console.WriteLine("[Error] Failed to open file : " + fileName); } }