Browse Source

Add more timer logs

pull/94/head
Anairkoen Schno 3 years ago
parent
commit
5cb86dc696
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
2 changed files with 18 additions and 4 deletions
  1. +6
    -0
      IPA.Injector/Injector.cs
  2. +12
    -4
      IPA.Injector/PermissionFix.cs

+ 6
- 0
IPA.Injector/Injector.cs View File

@ -6,6 +6,7 @@ using IPA.Utilities;
using Mono.Cecil;
using Mono.Cecil.Cil;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@ -128,6 +129,8 @@ namespace IPA.Injector
private static void InstallBootstrapPatch()
{
var sw = Stopwatch.StartNew();
var cAsmName = Assembly.GetExecutingAssembly().GetName();
var managedPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
@ -296,6 +299,9 @@ namespace IPA.Injector
#endif
}
#endregion
sw.Stop();
injector.Info($"Installing bootstrapper took {sw.Elapsed}");
}
private static bool bootstrapped;


+ 12
- 4
IPA.Injector/PermissionFix.cs View File

@ -1,4 +1,7 @@
using System;
using IPA.Logging;
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
@ -10,13 +13,16 @@ using Net3_Proxy;
namespace IPA.Injector
{
internal static class PermissionFix
{
{
[SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler",
Justification = "I very explicitly want the default scheduler")]
public static Task FixPermissions(DirectoryInfo root)
{
if (!root.Exists) return new Task(() => { });
return Task.Factory.StartNew(() =>
{
var sw = Stopwatch.StartNew();
try
{
var acl = root.GetAccessControl();
@ -56,9 +62,11 @@ namespace IPA.Injector
}
catch (Exception e)
{
Logging.Logger.log.Warn("Error configuring permissions in the game install dir");
Logging.Logger.log.Warn(e);
Logger.log.Warn("Error configuring permissions in the game install dir");
Logger.log.Warn(e);
}
sw.Stop();
Logger.log.Info($"Configuring permissions took {sw.Elapsed}");
});
}
}


Loading…
Cancel
Save