Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: ansicolor-plugin
    • Environment:
      Windows 2012 Server, Jenkins running as Service. Jenkins 1.621, Chrome 44.0.2403.125m (64 bit)
    • Similar Issues:

      Description

      I've been trying to get this plugin to work for msbuild output but I've been unable to figure out a set of options that would work. If it IS possible to do this already, could someone provide step by step instructions. If not, would you consider this in the future?

        Attachments

          Activity

          Hide
          kon Kalle Niemitalo added a comment -

          I don't think MSBuild itself supports outputting the SGR control sequences that ansicolor-plugin would recognize. The Microsoft.Build.Logging.ConsoleLogger class only sets Console.ForegroundColor or Console.BackgroundColor, and the .NET Framework on Windows implements those by calling SetConsoleTextAttribute, not by outputting characters.

          If you were running MSBuild on .NET Core Framework on Unix, then the System.Console class would output SGR control sequences, and it should just work.

          I think you can implement it on Windows by deriving a custom logger class from Microsoft.Build.Logging.ConsoleLogger, making its constructor call the ConsoleLogger(LoggerVerbosity, WriteHandler, ColorSetter, ColorResetter) constructor with delegates that output the SGR control sequences, and passing the name of the custom logger class to the MSBuild.exe /logger option.

          Show
          kon Kalle Niemitalo added a comment - I don't think MSBuild itself supports outputting the SGR control sequences that ansicolor-plugin would recognize. The Microsoft.Build.Logging.ConsoleLogger class only sets Console.ForegroundColor or Console.BackgroundColor, and the .NET Framework on Windows implements those by calling SetConsoleTextAttribute, not by outputting characters. If you were running MSBuild on .NET Core Framework on Unix, then the System.Console class would output SGR control sequences, and it should just work. I think you can implement it on Windows by deriving a custom logger class from Microsoft.Build.Logging.ConsoleLogger, making its constructor call the ConsoleLogger(LoggerVerbosity, WriteHandler, ColorSetter, ColorResetter) constructor with delegates that output the SGR control sequences, and passing the name of the custom logger class to the MSBuild.exe /logger option.
          Hide
          kon Kalle Niemitalo added a comment -

          My previous comment applies to MSBuild 14. In MSBuild 15, the /consoleloggerparameters:ForceConsoleColor option should do the trick.

          Show
          kon Kalle Niemitalo added a comment - My previous comment applies to MSBuild 14. In MSBuild 15, the /consoleloggerparameters:ForceConsoleColor option should do the trick.

            People

            • Assignee:
              Unassigned
              Reporter:
              mattisking Matt Philmon
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: