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

            var printerImpl = printer as LogPrinterBase;

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