Exemple #1
0
        public static void Print([NotNull] this IFatalLogPrinter printer, [NotNull] System.Exception exception, [NotNull] string message)
        {
            if (!printer.IsEnabled)
            {
                return;
            }

            var printerImpl = printer as LogPrinterBase;

            if (printerImpl != null)
            {
                printerImpl.PrintImpl(exception, LogMessage.Preformatted(message));
            }
        }
Exemple #2
0
        public static void PrintFormat([NotNull] this IFatalLogPrinter printer, [NotNull] System.Exception exception, [NotNull] string message, params object[] args)
        {
            if (!printer.IsEnabled)
            {
                FormattingHelper.ReleaseUnused(args);
                return;
            }

            var printerImpl = printer as LogPrinterBase;

            if (printerImpl != null)
            {
                var formattedMessage = LogMessage.FormatString(message, args);
                printerImpl.PrintImpl(exception, formattedMessage);
            }
        }