/// <summary> /// setup the Babalu perfmon counters /// </summary> /// <param name="context"></param> public static void SetupPerfmonCounters(InstallContext context) { context.LogMessage("Perfmon Babalu counters installer begins"); #if !DEBUG if (PerformanceCounterCategory.Exists(BabaluCounterDescriptions.CounterCategory)) PerformanceCounterCategory.Delete(BabaluCounterDescriptions.CounterCategory); #endif BabaluCounterDescriptions.InstallCounters(); context.LogMessage("Perfmon Babalu counters installer ends"); }
internal static void LogException(Exception e, InstallContext context) { bool flag = true; for (; e != null; e = e.InnerException) { if (flag) { context.LogMessage(e.GetType().FullName + ": " + e.Message); flag = false; } else { context.LogMessage(Res.GetString("InstallLogInner", (object)e.GetType().FullName, (object)e.Message)); } if (context.IsParameterTrue("showcallstack")) { context.LogMessage(e.StackTrace); } } }
/// <include file='doc\Installer.uex' path='docs/doc[@for="Installer.LogException"]/*' /> /// <devdoc> /// Writes exception information for the given inner exception and any /// inner exceptions it may have to the given context object. /// </devdoc> internal static void LogException(Exception e, InstallContext context) { bool toplevel = true; while (e != null) { if (toplevel) { context.LogMessage(e.GetType().FullName + ": " + e.Message); toplevel = false; } else { context.LogMessage(Res.GetString(Res.InstallLogInner, e.GetType().FullName, e.Message)); } if (context.IsParameterTrue("showcallstack")) { context.LogMessage(e.StackTrace); } e = e.InnerException; } }
internal static void LogException(Exception e, InstallContext context) { bool flag = true; while (e != null) { if (flag) { context.LogMessage(e.GetType().FullName + ": " + e.Message); flag = false; } else { context.LogMessage(Res.GetString("InstallLogInner", new object[] { e.GetType().FullName, e.Message })); } if (context.IsParameterTrue("showcallstack")) { context.LogMessage(e.StackTrace); } e = e.InnerException; } }
private static void WriteExceptions(Exception e, InstallContext context) { if (context == null) { return; } var aggregateException = e as AggregateException; if (aggregateException != null) { foreach (Exception child in aggregateException.InnerExceptions) { context.LogMessage(child.Message); } } else { context.LogMessage(e.Message); } }
private static void LogMessage(string message, InstallContext context) { if (context == null) { Console.WriteLine(message); } else { context.LogMessage(message); } }