Example #1
0
        public static void Print([NotNull] this IWarnLogPrinter 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));
            }
        }
Example #2
0
        public static void PrintFormat([NotNull] this IWarnLogPrinter 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);
            }
        }
Example #3
0
        public static void Print([NotNull] this IWarnLogPrinter printer, [NotNull] string message, params ILogField[] fields)
        {
            if (!printer.IsEnabled)
            {
                FormattingHelper.ReleaseUnused(fields);
                return;
            }

            var printerImpl = printer as LogPrinterBase;

            if (printerImpl != null)
            {
                var formattedMessage = LogMessage.MakeString(message, fields);
                printerImpl.PrintImpl(formattedMessage);
            }
        }