Skip to content

Instantly share code, notes, and snippets.

@dmulvi
Last active March 27, 2017 14:37
Show Gist options
  • Save dmulvi/c912f74ceda0e38f07dfb17eac35288d to your computer and use it in GitHub Desktop.
Save dmulvi/c912f74ceda0e38f07dfb17eac35288d to your computer and use it in GitHub Desktop.
SugarCRM Log Syntax Highlighter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>name</key>
<string>YOUR ACTIVE THEME</string>
<key>semanticClass</key>
<string>material.theme.default</string><!-- my active theme is material theme -->
<key>settings</key>
<array>
<!-- there are loads of material theme specific definitions removed for brevity -->
<!-- These are the sugarcrm log syntax specific items. You just need to add them to your active .tmTheme file inside the <array> block -->
<dict>
<key>scope</key>
<string>text.sugar_log_date_string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#8b8a8a</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>text.process_id</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#6f95af</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>text.user_id</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#F2F179</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>text.fatal_log_level</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FF0000</string>
<key>fontStyle</key>
<string>bold</string>
</dict>
</dict>
<!-- end of the sugarcrm log file specific definitions -->
</array>
<key>uuid</key>
<string>this was a guid string, just leave it alone in your case</string>
</dict>
</plist>
%YAML 1.2
---
name: SugarCRM Log
scope: source.sugarcrmlog
contexts:
main:
- match: \w{3}\s?\w{3}\s?\d{2}\s?\d{2}:\d{2}:\d{2}\s?\d{4}
scope: text.sugar_log_date_string
- match: \[\d{4,5}\]
scope: text.process_id
- match: \[\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\]
scope: text.user_id
- match: \[FATAL\]
scope: text.fatal_log_level
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment