Skip to content

Instantly share code, notes, and snippets.

@tzuhsun
Last active November 20, 2018 09:56
Show Gist options
  • Save tzuhsun/c5c9174954fcf9a5739b51d18fff37c1 to your computer and use it in GitHub Desktop.
Save tzuhsun/c5c9174954fcf9a5739b51d18fff37c1 to your computer and use it in GitHub Desktop.
This is the settings for https://github.com/fabiospampinato/vscode-highlight to highlight keywords in log file. Highlight rules are same with <script src="https://gist.github.com/tzuhsun/97a4b17c49505b5affb68df9f00434ab.js">tzuhsun/LogFile_UDL.xml</script>
// This is the settings for https://github.com/fabiospampinato/vscode-highlight
// to highlight keywords in log file.
// Highlight rules are same with <script src="https://gist.github.com/tzuhsun/97a4b17c49505b5affb68df9f00434ab.js"></script>
// Begin here
{
"workbench.colorTheme": "Solarized Dark",
"workbench.sideBar.location": "left",
"highlight.maxMatches": 0, // 0 - infinity
"highlight.regexes": {
// Example with multi-span color highlight in same regex
// "(// ?TODO?)(:)?(tzu)?(hsun)?": [
// {
// "regexFlags": "gi",
// "filterFileRegex": ".*\\.log",
// "overviewRulerColor": "#ffcc00",
// "backgroundColor": "#ffcc00",
// "color": "#1f1f1f",
// "fontWeight" : "bold"
// }
// // {"color" : "#ff0000"}
// // {"color" : "#4de0ff"},
// // {"color" : "#4de00f"}
// // {
// // "backgroundColor": "#d9ad00",
// // "color": "#1f1f1f"
// // }
// ],
// Fail - Prefix
"(\\b(error|fail|invalid|disconnect|wrong|false|remove))":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#ff0000",
"backgroundColor": "#ff0000",
"color": "#ffeeff",
"fontWeight": "bold"
}
]
},
// Fail - Exact
"(\\b(not)\\b)":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#ff0000",
"backgroundColor": "#ff0000",
"color": "#ffeeff"
}
]
},
// Success - Prefix
"(\\b(success|connect|ok|valid|pass|fixed|done|true))":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#00ff40",
"backgroundColor": "#00ff40",
"color": "#1f1f1f",
"fontWeight": "bold"
}
]
},
// Alert - Prefix
"(\\b(stop|start|end|begin|cancel|close|unknown))":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#ffff00",
"backgroundColor": "#ffff00",
"color": "#1f1f1f",
"fontWeight": "bold"
}
]
},
// Enclosed in bracket [], {}
"(\\[\\S+\\]|\\{\\S+\\})":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#f0ff80",
"backgroundColor": "#f0ff80",
"color": "#1f1f1f",
}
]
},
// IPv4 (Allow up to 999.999.999.999)
"(\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b)":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#ff80ff",
"backgroundColor": "#ff80ff",
"color": "#1f1f1f",
"fontWeight": "bold"
}
]
},
// SKOV HS_ - Prefix mode
"(\\b(HS_\\w+)\\b)":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#fff3e8",
"backgroundColor": "#fff3e8",
"color": "#620000",
"fontWeight": "bold"
}
]
},
// Custom text to highlight - Prefix mode
"((kkk|SlaveUnitAdded|subnet|addSlave|onPeerValidated))":
{
"regexFlags": "gi",
"filterFileRegex": ".*\\.log",
"decorations" : [
{
"overviewRulerColor": "#ff8080",
"backgroundColor": "#ff8080",
"color": "#1f1f1f",
"fontWeight": "bold"
}
]
}
},
"files.autoSave": "off",
"editor.minimap.enabled": true,
"window.zoomLevel": 0,
"window.menuBarVisibility": "default",
"breadcrumbs.enabled": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment