private static void LogEntryHr(ActivityLogEntryType type, string source, string message, int hr) { IVsActivityLog log = Log; if (log != null) { log.LogEntryHr(VsxConverter.MapLogTypeToAle(type), source, message, hr); } }
/// <summary> /// Creates a new log entry /// </summary> /// <param name="type">Category of the entry</param> /// <param name="message">Message</param> /// <param name="hr">HResult that caused the error</param> public static void Log(EntryType type, string message, int hr) { if (message == null) { throw new ArgumentNullException("message"); } if (Source == null) { throw new InvalidOperationException("ActivityLogger is not sufficiently initialized."); } int returnHr = logService.LogEntryHr((uint)type, Source, message, hr); Marshal.ThrowExceptionForHR(returnHr); }