Beispiel #1
0
        /// <summary>
        /// Logs debugging related information.
        /// </summary>
        /// <param name="component">Identifies the component described by the trace.</param>
        /// <param name="level">Specifies the relative importance of the trace.</param>
        /// <param name="format">The message format string.</param>
        /// <param name="args">The formatting arguments.</param>
        public static void Trace(string component, SysLogLevel level, string format, params object[] args)
        {
            if (level != SysLogLevel.High)
            {
                return;
            }

            Trace(null, component, level, format, args);
        }
Beispiel #2
0
        /// <summary>
        /// Logs debugging related information with optional extended information.
        /// </summary>
        /// <param name="extension">Extended log information (or <c>null</c>).</param>
        /// <param name="component">Identifies the component described by the trace.</param>
        /// <param name="level">Specifies the relative importance of the trace.</param>
        /// <param name="format">The message format string.</param>
        /// <param name="args">The formatting arguments.</param>
        public static void Trace(ISysLogEntryExtension extension, string component, SysLogLevel level, string format, params object[] args)
        {
            if (level != SysLogLevel.High)
            {
                return;
            }

            if (provider == null)
            {
                return;
            }

            var message = args.Length > 0 ? string.Format(format, args) : format;

            provider.Trace(extension, component, message);
        }