Exemplo n.º 1
0
        void LogReport(CGFParserReportDetails.Level level, string message)
        {
            CGFParserReportDetails reportDetails = new CGFParserReportDetails();

            reportDetails.ErrorLevel   = level;
            reportDetails.ErrorMessage = message;
            LogReport(reportDetails);
        }
Exemplo n.º 2
0
        void LogReport(CGFParserReportDetails reportDetails)
        {
            int       depth = 0;
            const int indentationPerDepth = 2;

            if (m_ReporterContextStack.Count > 0)
            {
                CGFParserReporterContext[] contextList = m_ReporterContextStack.ToArray();
                for (int contextIndex = contextList.Length - 1; contextIndex >= 0; --contextIndex)
                {
                    CGFParserReporterContext context = contextList[contextIndex];
                    Console.WriteLine($"[{ reportDetails.ErrorLevel.ToString() }]" + "".PadLeft(depth + 1) + context.ContextName);
                    depth += indentationPerDepth;
                }
            }

            Console.WriteLine($"[{ reportDetails.ErrorLevel.ToString() }]" + "".PadLeft(depth + 1) + $"{ reportDetails.ErrorMessage }".PadLeft(depth));

            m_ReportDetailsLevelCount[(int)reportDetails.ErrorLevel]++;
        }