Exemple #1
0
        public void Log(CompilerLogItem item)
        {
            if (item == null)
            {
                return;
            }
            Items.Enqueue(item);
            var sb = new StringBuilder();

            if (item.ProjectRelativeFilename.IsEmpty())
            {
                sb.AppendFormat("{0}", item.ProjectRelativeFilename);
            }
            if (item.Line > 0 && item.Column > 0)
            {
                sb.AppendFormat("({0},{1})", item.Line, item.Column);
            }
            if (item.ProjectRelativeFilename.IsEmpty() || (item.Line > 0 && item.Column > 0))
            {
                sb.Append(": ");
            }

            sb.AppendFormat("{0} {1}{2}: {3}", item.Type.ToString().ToLower(), "SK", item.Code.ToString("0000"), item.Text);
            if (item.AbsoluteFilename.IsEmpty())
            {
                sb.AppendFormat(" [{0}]", item.AbsoluteFilename);
            }
            var ss = sb.ToString();

            Console.WriteLine(ss);
            //"Compilation\JsCompiler.cs(175,26): warning CS0169: The field 'SharpKit.JavaScript.Compilation.JsCompiler.__LastException' is never used [C:\Projects\SharpKit\googlecode\trunk\SharpKit.JsClr-4.1.0\SharpKit.JsClr-4.1.0.csproj]
        }
        public void Log(CompilerLogItem item)
        {
            if (item == null)
                return;
            Items.Enqueue(item);
            var sb = new StringBuilder();
            if (item.ProjectRelativeFilename.IsEmpty())
                sb.AppendFormat("{0}", item.ProjectRelativeFilename);
            if (item.Line > 0 && item.Column > 0)
                sb.AppendFormat("({0},{1})", item.Line, item.Column);
            if (item.ProjectRelativeFilename.IsEmpty() || (item.Line > 0 && item.Column > 0))
                sb.Append(": ");

            sb.AppendFormat("{0} {1}{2}: {3}", item.Type.ToString().ToLower(), "SK", item.Code.ToString("0000"), item.Text);
            if (item.AbsoluteFilename.IsEmpty())
                sb.AppendFormat(" [{0}]", item.AbsoluteFilename);
            var ss = sb.ToString();
            Console.WriteLine(ss);
            //"Compilation\JsCompiler.cs(175,26): warning CS0169: The field 'SharpKit.JavaScript.Compilation.JsCompiler.__LastException' is never used [C:\Projects\SharpKit\googlecode\trunk\SharpKit.JsClr-4.1.0\SharpKit.JsClr-4.1.0.csproj]
        }