Esempio n. 1
0
        public static void Print([NotNull] this IInfoLogPrinter printer, [NotNull] string message)
        {
            if (!printer.IsEnabled)
            {
                return;
            }

            var printerImpl = printer as LogPrinterBase;

            if (printerImpl != null)
            {
                printerImpl.PrintImpl(LogMessage.Preformatted(message));
            }
        }
Esempio n. 2
0
        public static void PrintFormat([NotNull] this IInfoLogPrinter printer, [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(formattedMessage);
            }
        }
Esempio n. 3
0
        public static void Print([NotNull] this IInfoLogPrinter 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);
            }
        }