Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        /// <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>
        /// <param name="path">File path that will be written to the log</param>
        public static void Log(EntryType type, string message, int hr, string path)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (Source == null)
            {
                throw new InvalidOperationException("ActivityLogger is not sufficiently initialized.");
            }

            int returnHr = logService.LogEntryHrPath((uint)type, Source, message, hr, path);

            Marshal.ThrowExceptionForHR(returnHr);
        }