Ejemplo n.º 1
0
        public void Process(LinkContext context)
        {
            var msgError       = MessageContainer.CreateCustomErrorMessage("Error", 6001);
            var msgWarning     = MessageContainer.CreateCustomWarningMessage(context, "Warning", 6002, origin: new MessageOrigin("logtest", 1, 1), version: WarnVersion.Latest);
            var msgInfo        = MessageContainer.CreateInfoMessage("Info");
            var msgDiagnostics = MessageContainer.CreateDiagnosticMessage("Diagnostics");

            context.LogMessage(msgError);
            context.LogMessage(msgWarning);
            context.LogMessage(msgInfo);
            context.LogMessage(msgDiagnostics);
        }
Ejemplo n.º 2
0
        public void MSBuildFormat()
        {
            LinkContext context = new LinkContext(new Pipeline(), new ConsoleLogger(), string.Empty);

            var msg = MessageContainer.CreateCustomErrorMessage("text", 6001);

            Assert.AreEqual("ILLink: error IL6001: text", msg.ToMSBuildString());

            msg = MessageContainer.CreateCustomWarningMessage(context, "message", 6002, new MessageOrigin("logtest", 1, 1), WarnVersion.Latest);
            Assert.AreEqual("logtest(1,1): warning IL6002: message", msg.ToMSBuildString());

            msg = MessageContainer.CreateInfoMessage("log test");
            Assert.AreEqual("ILLink: log test", msg.ToMSBuildString());
        }