├── .gitignore ├── .vscode └── launch.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── github-assets ├── icon.png ├── screenshot-1.jpg ├── screenshot-2.jpg ├── screenshot-3.jpg └── screenshot-4.jpg ├── gulpfile.js ├── log.configuration.json ├── package.json └── src └── syntaxes └── log.tmLanguage /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | *.vsix 40 | 41 | out 42 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": [ 10 | "--extensionDevelopmentPath=${workspaceRoot}" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Issues 2 | 3 | If you encounter an issue with this extension you are welcome to submit a [bug report](https://github.com/IBM-Bluemix/vscode-log-output-colorizer/issues). Before that, please search for similar issues. It's possible somebody has encountered this issue already. 4 | 5 | # Pull Requests 6 | 7 | If you want to contribute to the repository, here's a quick guide: 8 | 9 | 1. Fork the repo. 10 | 2. develop your code changes 11 | 3. Commit your changes 12 | 4. Push to your fork and submit a pull request 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 International Business Machines 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VSCode Log Output Colorizer 2 | [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/IBM-Bluemix/vscode-log-output-colorizer/master/LICENSE) 3 | [![Version](https://vsmarketplacebadge.apphb.com/version/IBM.output-colorizer.svg)](https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer) 4 | [![Installs](https://vsmarketplacebadge.apphb.com/installs/IBM.output-colorizer.svg)](https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer) 5 | [![Ratings](https://vsmarketplacebadge.apphb.com/rating/IBM.output-colorizer.svg)](https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer) 6 | 7 | Language extension for VSCode/Bluemix Code that adds syntax colorization for both the output/debug/extensions panel and `*.log` files. 8 | 9 | **Note: If you are using other extensions that colorize the output panel, it could override and disable this extension.** 10 | 11 | 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. 12 | 13 | ## Change Log 14 | 15 | * **0.1.2** - Updated for compliance with upcoming VS Code marketplace changes 16 | * **0.1.1** - Regex updates for color coding support 17 | 18 | ## Contributing 19 | You can contribute to the project by reading the [Contribution guidelines](https://github.com/IBM-Bluemix/vscode-log-output-colorizer/blob/master/CONTRIBUTING.md) 20 | 21 | ## In action 22 | 23 | ### VSCode Git Output 24 | ![Colorized Git Output](https://raw.githubusercontent.com/IBM-Bluemix/vscode-log-output-colorizer/master/github-assets/screenshot-4.jpg) 25 | 26 | ### Default Dark Theme 27 | ![Default Dark Theme](https://raw.githubusercontent.com/IBM-Bluemix/vscode-log-output-colorizer/master/github-assets/screenshot-1.jpg) 28 | 29 | ### Default Light Theme 30 | ![Default Light Theme](https://raw.githubusercontent.com/IBM-Bluemix/vscode-log-output-colorizer/master/github-assets/screenshot-2.jpg) 31 | 32 | ### Night Blue Theme 33 | ![Night Blue Theme](https://raw.githubusercontent.com/IBM-Bluemix/vscode-log-output-colorizer/master/github-assets/screenshot-3.jpg) 34 | 35 | ## Helpful References: 36 | 37 | * https://code.visualstudio.com/docs/customization/colorizer 38 | * http://stackoverflow.com/questions/33403324/how-to-create-a-simple-custom-language-colorization-to-vs-code 39 | * http://manual.macromates.com/en/language_grammars 40 | 41 | ## Support 42 | You can open an issue on the [GitHub repo](https://github.com/IBM-Bluemix/vscode-log-output-colorizer/issues) 43 | 44 | ## License 45 | [MIT](LICENSE) 46 | 47 | ## Attribution 48 | Portions of the language grammar are based off of a StackOverflow question, asked by user [emilast](http://stackoverflow.com/users/736684/emilast) and answered by user [Wosi](http://stackoverflow.com/users/2023316/wosi), availble under [Creative Commons](http://blog.stackoverflow.com/2009/06/attribution-required/) at: http://stackoverflow.com/questions/33403324/how-to-create-a-simple-custom-language-colorization-to-vs-code 49 | -------------------------------------------------------------------------------- /github-assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/vscode-log-output-colorizer/26eb53df4c8a53b5d8f8dfa760137967bc56faf9/github-assets/icon.png -------------------------------------------------------------------------------- /github-assets/screenshot-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/vscode-log-output-colorizer/26eb53df4c8a53b5d8f8dfa760137967bc56faf9/github-assets/screenshot-1.jpg -------------------------------------------------------------------------------- /github-assets/screenshot-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/vscode-log-output-colorizer/26eb53df4c8a53b5d8f8dfa760137967bc56faf9/github-assets/screenshot-2.jpg -------------------------------------------------------------------------------- /github-assets/screenshot-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/vscode-log-output-colorizer/26eb53df4c8a53b5d8f8dfa760137967bc56faf9/github-assets/screenshot-3.jpg -------------------------------------------------------------------------------- /github-assets/screenshot-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/vscode-log-output-colorizer/26eb53df4c8a53b5d8f8dfa760137967bc56faf9/github-assets/screenshot-4.jpg -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var zip = require('gulp-vinyl-zip').zip; 3 | 4 | gulp.task('build-zip', () => { 5 | return gulp.src([ 6 | 'src/**', 7 | 'LICENSE', 8 | 'package.json', 9 | 'github-assets/**', 10 | 'README.md' 11 | ], { base: '.' }) 12 | .pipe(zip(`vscode-log-output-colorizer.zip`)) 13 | .pipe(gulp.dest('./out')); 14 | }); -------------------------------------------------------------------------------- /log.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | // symbols used as brackets 3 | "brackets": [ 4 | ["{", "}"], 5 | ["[", "]"], 6 | ["(", ")"], 7 | ["<", ">"] 8 | ], 9 | // symbols that are auto closed when typing 10 | "autoClosingPairs": [ 11 | ["{", "}"], 12 | ["[", "]"], 13 | ["(", ")"], 14 | ["\"", "\""], 15 | ["'", "'"] 16 | ], 17 | // symbols that that can be used to surround a selection 18 | "surroundingPairs": [ 19 | ["{", "}"], 20 | ["[", "]"], 21 | ["(", ")"], 22 | ["\"", "\""], 23 | ["'", "'"] 24 | ] 25 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "output-colorizer", 3 | "displayName": "Output Colorizer", 4 | "description": "Syntax highlighting for log files", 5 | "version": "0.1.2", 6 | "publisher": "IBM", 7 | "engines": { 8 | "vscode": "^1.0.0" 9 | }, 10 | "categories": [ 11 | "Languages" 12 | ], 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/IBM-Bluemix/vscode-log-output-colorizer.git" 16 | }, 17 | "author": { 18 | "name": "Andrew Trice", 19 | "email": "amtrice@us.ibm.com" 20 | }, 21 | "contributors": [ 22 | { 23 | "name": "Jeff Sloyer", 24 | "email": "jbsloyer@us.ibm.com" 25 | } 26 | ], 27 | "contributes": { 28 | "languages": [ 29 | { 30 | "id": "Log", 31 | "aliases": [ 32 | "log" 33 | ], 34 | "extensions": [ 35 | ".log" 36 | ], 37 | "configuration": "./log.configuration.json", 38 | "mimetypes": [ 39 | "log", 40 | "text/log", 41 | "text/x-log", 42 | "text/x-code-output", 43 | "x-code-output" 44 | ] 45 | } 46 | ], 47 | "grammars": [ 48 | { 49 | "language": "Log", 50 | "scopeName": "code.log", 51 | "path": "./src/syntaxes/log.tmLanguage" 52 | } 53 | ] 54 | }, 55 | "devDependencies": { 56 | "gulp": "^3.9.1", 57 | "gulp-vinyl-zip": "^1.2.2", 58 | "vscode": "^0.11.0" 59 | }, 60 | "galleryBanner": { 61 | "color": "#f2f2f2", 62 | "theme": "light" 63 | }, 64 | "icon": "github-assets/icon.png", 65 | "bugs": { 66 | "url": "https://github.com/IBM-Bluemix/vscode-log-output-colorizer/issues" 67 | }, 68 | "license": "MIT", 69 | "homepage": "https://github.com/IBM-Bluemix/vscode-log-output-colorizer/blob/master/README.md", 70 | "keywords": [ 71 | "IBM", 72 | "log", 73 | "color", 74 | "output" 75 | ] 76 | } -------------------------------------------------------------------------------- /src/syntaxes/log.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | scopeName 6 | code.log 7 | fileTypes 8 | 9 | log 10 | 11 | name 12 | Log file 13 | patterns 14 | 15 | 16 | 17 | match 18 | "(.*?)" 19 | name 20 | string.quoted 21 | 22 | 23 | 24 | match 25 | '(.*?)' 26 | name 27 | string.quoted 28 | 29 | 36 | 37 | 38 | match 39 | \b(?i:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))\b 40 | name 41 | support.class 42 | 43 | 44 | 45 | match 46 | \S+@\S+\.\S+ 47 | name 48 | markup.bold 49 | 50 | 51 | 52 | match 53 | \b(?i:((\.)*[a-z]|[0-9])*(Exception|Error|Failure|Fail))\b 54 | name 55 | invalid 56 | 57 | 58 | 59 | match 60 | \b(((0|1)?[0-9][1-2]?)|(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sept(ember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?))[/|\-|\.| ]([0-2]?[0-9]|[3][0-1])[/|\-|\.| ]((19|20)?[0-9]{2})\b 61 | name 62 | constant.numeric 63 | 64 | 65 | 66 | match 67 | \b((19|20)?[0-9]{2}[/|\-|\.| ](((0|1)?[0-9][1-2]?)|(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sept(ember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?))[/|\-|\.| ]([0-2]?[0-9]|[3][0-1]))\b 68 | name 69 | constant.numeric 70 | 71 | 72 | 73 | match 74 | \b([0-2]?[0-9]|[3][0-1])[/|\-|\.| ](((0|1)?[0-9][1-2]?)|(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sept(ember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?))[/|\-|\.| ]((19|20)?[0-9]{2})\b 75 | name 76 | constant.numeric 77 | 78 | 79 | 80 | match 81 | \b([0|1]?[0-9]|2[0-3])\:[0-5][0-9](\:[0-5][0-9])?( ?(?i:(a|p)m?))?( ?[+-]?[0-9]*)?\b 82 | name 83 | constant.numeric 84 | 85 | 86 | 87 | match 88 | \b\d+\.?\d*?\b 89 | name 90 | constant.numeric 91 | 92 | 93 | 94 | match 95 | \b(?i:(0?x)?[0-9a-f][0-9a-f]+)\b 96 | name 97 | constant.numeric 98 | 99 | 100 | 101 | match 102 | \b(?i:(([a-z]|[0-9]|[_|-])*(\.([a-z]|[0-9]|[_|-])*)+))\b 103 | name 104 | support.type 105 | 106 | 107 | match 108 | \b(?i:(Down|Error|Failure|Fail|Fatal|false))(\:|\b) 109 | name 110 | invalid.illegal 111 | 112 | 113 | match 114 | \b(?i:(hint|info|information|true|log))(\:|\b) 115 | name 116 | keyword 117 | 118 | 119 | match 120 | \b(?i:(warning|warn|test|debug|null|undefined|NaN))(\:|\b) 121 | name 122 | invalid.deprecated 123 | 124 | 125 | match 126 | \b(?i:(local))(\:|\b) 127 | name 128 | support.function 129 | 130 | 131 | match 132 | \b(?i:(server|running|remote))(\:|\b) 133 | name 134 | comment.line 135 | 136 | 137 | 138 | match 139 | \b(?i:([a-z]|[0-9])+\:((\/\/)|((\/\/)?(\S)))+) 140 | name 141 | storage 142 | 143 | 144 | 145 | match 146 | (-)+>|├(─)+|└(─)+ 147 | name 148 | comment.line 149 | 150 | 151 | uuid 152 | ab259404-3072-4cd4-a943-7cbbd32e373f 153 | 154 | --------------------------------------------------------------------------------