// -------------------------------------------------------------------------------- /// <summary> /// Creates a log entry with the specified type and message. /// </summary> /// <param name="type">Type of the log entry</param> /// <param name="message">Message string</param> // -------------------------------------------------------------------------------- public ActivityLogEntry(ActivityLogEntryType type, string message) { Hr = null; Guid = null; Type = type; Message = message; }
private static void LogEntry(ActivityLogEntryType type, string source, string message) { IVsActivityLog log = Log; if (log != null) { log.LogEntry(VsxConverter.MapLogTypeToAle(type), source, message); } }
private static void LogEntryGuidHr(ActivityLogEntryType type, string source, string message, Guid guid, int hr) { IVsActivityLog log = Log; if (log != null) { log.LogEntryGuidHr(VsxConverter.MapLogTypeToAle(type), source, message, guid, hr); } }
private static void LogEntryHrPath(ActivityLogEntryType type, string source, string message, int hr, string path) { IVsActivityLog log = Log; if (log != null) { log.LogEntryHrPath(VsxConverter.MapLogTypeToAle(type), source, message, hr, path); } }
// -------------------------------------------------------------------------------- /// <summary> /// Converts <see cref="ActivityLogEntryType"/> values to corresponding UInt32 values. /// </summary> /// <param name="logType">ActivitiLogType value to convert.</param> /// <returns> /// UInt32 representation of the ActivityLogEntryType input. /// </returns> // -------------------------------------------------------------------------------- public static UInt32 MapLogTypeToAle(ActivityLogEntryType logType) { switch (logType) { case ActivityLogEntryType.Information: return((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_INFORMATION); case ActivityLogEntryType.Warning: return((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_WARNING); default: return((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR); } }
// -------------------------------------------------------------------------------- /// <summary> /// Creates a log entry with the specified type, source and message. /// </summary> /// <param name="type">Type of the log entry</param> /// <param name="source">Source string</param> /// <param name="message">Message string</param> // -------------------------------------------------------------------------------- public ActivityLogEntry(ActivityLogEntryType type, string source, string message) { Hr = null; Guid = null; Type = type; Source = source; Message = message; }
private static void LogEntryPath(ActivityLogEntryType type, string source, string message, string path) { IVsActivityLog log = Log; if (log != null) { log.LogEntryPath(VsxConverter.MapLogTypeToAle(type), source, message, path); } }
// -------------------------------------------------------------------------------- /// <summary> /// Creates an activity log entry with the specified type, source, message, GUID, /// HRESULT and path. /// </summary> /// <param name="type">Entry type</param> /// <param name="source">Event source</param> /// <param name="message">Event message</param> /// <param name="guid">GUID of the entry</param> /// <param name="hr">HRESULT of the entry</param> /// <param name="path">Path of the message</param> // -------------------------------------------------------------------------------- public static void Write(ActivityLogEntryType type, string source, string message, Guid guid, int hr, string path) { LogEntryGuidHrPath(type, source, message, guid, hr, path); }
// -------------------------------------------------------------------------------- /// <summary> /// Creates an activity log entry with the specified type, source, message /// and path. /// </summary> /// <param name="type">Entry type</param> /// <param name="source">Event source</param> /// <param name="message">Event message</param> /// <param name="path">Path of the message</param> // -------------------------------------------------------------------------------- public static void Write(ActivityLogEntryType type, string source, string message, string path) { LogEntryPath(type, source, message, path); }
// -------------------------------------------------------------------------------- /// <summary> /// Creates an activity log entry with the specified type, source, message /// and GUID. /// </summary> /// <param name="type">Entry type</param> /// <param name="source">Event source</param> /// <param name="message">Event message</param> /// <param name="guid">GUID of the entry</param> // -------------------------------------------------------------------------------- public static void Write(ActivityLogEntryType type, string source, string message, Guid guid) { LogEntryGuid(type, source, message, guid); }
// -------------------------------------------------------------------------------- /// <summary> /// Creates an activity log entry with the specified type, source, message /// and HRESULT. /// </summary> /// <param name="type">Entry type</param> /// <param name="source">Event source</param> /// <param name="message">Event message</param> /// <param name="hr">HRESULT of the entry</param> // -------------------------------------------------------------------------------- public static void Write(ActivityLogEntryType type, string source, string message, int hr) { LogEntryHr(type, source, message, hr); }
// -------------------------------------------------------------------------------- /// <summary> /// Converts <see cref="ActivityLogEntryType"/> values to corresponding UInt32 values. /// </summary> /// <param name="logType">ActivitiLogType value to convert.</param> /// <returns> /// UInt32 representation of the ActivityLogEntryType input. /// </returns> // -------------------------------------------------------------------------------- public static UInt32 MapLogTypeToAle(ActivityLogEntryType logType) { switch (logType) { case ActivityLogEntryType.Information: return (UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_INFORMATION; case ActivityLogEntryType.Warning: return (UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_WARNING; default: return (UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR; } }
// -------------------------------------------------------------------------------- /// <summary> /// Creates an activity log entry with the specified type, source and message. /// </summary> /// <param name="type">Entry type</param> /// <param name="source">Event source</param> /// <param name="message">Event message</param> // -------------------------------------------------------------------------------- public static void Write(ActivityLogEntryType type, string source, string message) { LogEntry(type, source, message); }