Skip to content

Language extension for VSCode that adds syntax colorization for both the output/debug/extensions panel and *.log files.

License

Notifications You must be signed in to change notification settings

cvlvxi/vscode-log-output-colorizer

 
 

Repository files navigation

VSCode Log Output Colorizer

License Version Installs Ratings

Language extension for VSCode/Bluemix Code that adds syntax colorization for both the output/debug/extensions panel and *.log files.

Note: If you are using other extensions that colorize the output panel, it could override and disable this extension.

Colorization should work with most themes because it uses common theme token style names. It also works with most instances of the output panel. Initially attempts to match common literals (strings, dates, numbers, guids) and warning|info|error|server|local messages.

Customization

You can customize the semantic identification of the output by adding entries to outputcolorizer.semantics.

Example:

In settings.json:

    "outputcolorizer.semantics": [
        {
            "pattern": "{.*}",
            "applies": "between",
            "tokenType": "info",
            "tokenModifier": "output"
        },
    ]

This will identify anything inside the matching regex pattern as info.output semantics. Now you are free to add your own color rule:

// settings.json
    "editor.semanticTokenColorCustomizations": {
        "rules": {
            "error.output": "#ff0000",
            "info.output": "#00ff00"
        },
    },

Settings Object:

interface SemanticObject {
  pattern: string;    // A Regex compliant string
  applies: 'between' | 'eol' | 'eof';
  tokenType: string;
  tokenModifier: string;
}
  • pattern

    This is a regex string fed into RegExp() class. Escape rules apply just as they would to the RegExp class in javascript.

  • applies

    Applies Description
    between From the start to the end of the regex will be identified by the semantic tokenType.tokenModifier
    eol From the start of the regex match to the end of the line will be identified by the sematnic tokenType.tokenModifier, unless another token occurs before then
    eof From the start of the regex match to the end of the file will be identified by the sematnic tokenType.tokenModifier, unless another token occurs before then
  • tokenType

    This can be either a standard token or a custom name that you would like to assign values to separately.

  • tokenModifier

    This can be either a standard modifier or a custom name that you would like to assign values to separately.

Change Log

  • 0.1.2 - Updated for compliance with upcoming VS Code marketplace changes
  • 0.1.1 - Regex updates for color coding support

Contributing

You can contribute to the project by reading the Contribution guidelines

In action

VSCode Git Output

Colorized Git Output

Default Dark Theme

Default Dark Theme

Default Light Theme

Default Light Theme

Night Blue Theme

Night Blue Theme

Helpful References:

Support

You can open an issue on the GitHub repo

License

MIT

Attribution

Portions of the language grammar are based off of a StackOverflow question, asked by user emilast and answered by user Wosi, availble under Creative Commons at: http://stackoverflow.com/questions/33403324/how-to-create-a-simple-custom-language-colorization-to-vs-code

About

Language extension for VSCode that adds syntax colorization for both the output/debug/extensions panel and *.log files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 94.3%
  • JavaScript 5.2%
  • Shell 0.5%