Esempio n. 1
0
        /// <summary>
        /// Constructs a log entry and writes it to the specified log writer's event listeners
        /// from the Alert category with severity Critical.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="format">The format.</param>
        /// <param name="args">The arguments.</param>
        public static LogWriter AlertCritical(
            this LogWriter logger,
            string format,
            params object[] args)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (format.IsNullOrWhiteSpace())
            {
                throw new ArgumentException("The argument cannot be null, empty string or consist of whitespace characters only.", nameof(format));
            }
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            return(logger.AlertMessage(TraceEventType.Critical, format, args));
        }