Language Module for Logs

161 views
Skip to first unread message

BeeRich33

unread,
Nov 14, 2023, 9:38:48 AM11/14/23
to BBEdit Talk
I'm trying to make some logs more visible as currently they are just a sea of white text.  Is there a way to provide a plist and match this up to log files?  Am I correct in assuming it should be in the Language Modules directory and be named log.plist?

Cheers

Benjamin Irwin

unread,
Nov 16, 2023, 8:28:28 AM11/16/23
to BBEdit Talk
BeeRich33

I have attached a very simple Language Module that you may be able to modify for your needs.

It is in ~/Library/Application Support/BEdit/Language Modules

Modifying the command list in the BBLMKeywordList and BBLMPredefinedNameList would cause those words to be colored to "pop out" when viewing the logs.

Hope this helps,
Ben

MUMPS.plist

BeeRich33

unread,
Nov 16, 2023, 3:31:05 PM11/16/23
to Submit BBEdit Group
Hi Ben.  Thanks for the file.  

I’ve been looking at the other CLMs and that’s pretty much what I’ve come up with as well.  Not active yet.  

Darren Duncan

unread,
Nov 17, 2023, 8:31:49 AM11/17/23
to bbe...@googlegroups.com
You may also find useful this codeless language module I made, for reference.

https://github.com/muldis/Muldis_Object_Notation/blob/master/tooling/BBEdit/BBEdit_LM_Muldis_Object_Notation_Plain_Text.plist

-- Darren Duncan

BeeRich33

unread,
Nov 17, 2023, 12:08:23 PM11/17/23
to BBEdit Talk
Excellent.  Will take a look.  Thank you.  

BeeRich33

unread,
Nov 19, 2023, 2:28:51 PM11/19/23
to BBEdit Talk
So I've tried many plist entries and I've not been able to get this going for some reason.  I'm not sure if it's the plist structure or the BBEdit preferences.  Here is my plist, which is the most simple I have come up with:

<?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>BBEditDocumentType</key>
    <string>CodelessLanguageModule</string>
    <key>BBLMLanguageDisplayName</key>
    <string>Passenger Log</string>
    <key>BBLMLanguageCode</key>
    <string>PLOG</string>
    <key>name</key>
    <string>PassengerLogs</string>
    <key>BBLMColorsSyntax</key>
    <true/>
    <key>language</key>
    <dict>
        <key>name</key>
        <string>PassengerLogs</string>
        <key>fileExtensions</key>
        <array>
            <string>pog</string>
        </array>
        <key>keywords</key>
        <array>
            <string>error</string>
            <string>GET</string>
            <string>POST</string>
            <string>NameError</string>
            <string>undefined</string>
            <string>Exception</string>
        </array>
    </dict>
</dict>
</plist>

I was hoping for the following BB setting:

Languages: Custom filename extension mappings: .pog => Passenger Log

I can't see Passenger Log as an option.

Not sure where to go from here.  Any advice?

Cheers


Rich Siegel

unread,
Nov 19, 2023, 4:10:44 PM11/19/23
to BBEdit Talk
On 19 Nov 2023, at 14:28, BeeRich33 wrote:

> So I've tried many plist entries and I've not been able to get this going
> for some reason. I'm not sure if it's the plist structure or the BBEdit
> preferences. Here is my plist, which is the most simple I have come up
> with:

Likely it's in the wrong place, or it's malformed.

To see if it's in the right place: choose "Language Modules" from the Folders submenu of the BBEdit application menu. If your plist file isn't in the Finder window that opens, it's in the wrong place.

If it's in the right place, choose "Logs" from the Folders submenu. If there's a log file for language module errors, open it up and look inside; the recent entries (if any) may contain diagnostic information.

R.

BeeRich33

unread,
Nov 19, 2023, 4:34:49 PM11/19/23
to Submit BBEdit Group
Ya I validated it but I’m using the Dropbox alternative location for this file.  When I use the menu option to open the Language Module directory, the Dropbox path is the path that opens up.  

/Users/rich/Library/CloudStorage/Dropbox/Application Support/BBEdit/Language Modules/PassengerLogs.plist

So that CLM log says the following, even with the edited version.  That BBLMLanguageFeatures is now in the file.  The log isn’t specific other than that.

—————————

The following problem(s) were encountered while loading the language module at /Users/rich/Library/CloudStorage/Dropbox/Application Support/BBEdit/Language Modules/PassengerLogs.plist:
The Language Features key is missing.
The reported problems will prevent the language module from loading.

<?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>BBEditDocumentType</key>
    <string>CodelessLanguageModule</string>
    <key>BBLMLanguageDisplayName</key>
    <string>Passenger Log</string>
    <key>BBLMLanguageCode</key>
    <string>PLOG</string>
    <key>name</key>
    <string>PassengerLogs</string>
    <key>BBLMColorsSyntax</key>
    <true/>
    <key>BBLMLanguageFeatures</key>
    <dict>
<key>SyntaxColoring</key>
<true/>
<key>FunctionNavigation</key>
<true/>
<key>SymbolCompletion</key>
<true/>
    </dict>
    <key>language</key>
    <dict>
<key>name</key>
<string>PassengerLogs</string>
<key>fileExtensions</key>
<array>
<string>pog</string>
</array>
<key>keywords</key>
<array>
<string>error</string>
<string>GET</string>
<string>POST</string>
<string>NameError</string>
<string>undefined</string>
<string>Exception</string>
</array>
    </dict>
</dict>
</plist>

BeeRich33

unread,
Nov 19, 2023, 4:56:46 PM11/19/23
to BBEdit Talk
Ok that entry should have been this:

<key>Language Features</key>

So this is what I currently have, and the settings has the assigned .pog suffic mapped to this language.  However, no syntax colouring.

 <?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>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageDisplayName</key>
<string>Passenger Log</string>
<key>BBLMLanguageCode</key>
<string>PLOG</string>
<key>name</key>
<string>PassengerLogs</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMKeywordList</key>

<array>
<string>error</string>
<string>GET</string>
<string>POST</string>
<string>NameError</string>
<string>undefined</string>
<string>Exception</string>
</array>
<key>Language Features</key>

<dict>
<key>SyntaxColoring</key>
<true/>
<key>FunctionNavigation</key>
<true/>
<key>SymbolCompletion</key>
<true/>
</dict>
<key>language</key>
<dict>
<key>name</key>
<string>PassengerLogs</string>
<key>fileExtensions</key>
<array>
<string>pog</string>
</array>
</dict>
</dict>
</plist>


BeeRich33

unread,
Nov 20, 2023, 6:00:28 PM11/20/23
to BBEdit Talk
Fixed.  I had to add the Language Feature: Identifier and Keyword Character Class:

<?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>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageDisplayName</key>
<string>Passenger Log</string>
<key>BBLMLanguageCode</key>
<string>PLOG</string>
<key>BBLMFileNamesToMatch</key>
<array>
<string>passenger_log.pog</string>
</array>

<key>name</key>
<string>PassengerLogs</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMIsCaseSensitive</key>
<false/>

<key>Language Features</key>
<dict>
<key>SyntaxColoring</key>
<true/>
<key>Identifier and Keyword Character Class</key>
<string>A-Za-z0-9_\?!</string>
</dict>

<key>BBLMKeywordList</key>
<array>
<string>error</string>
<string>GET</string>
<string>POST</string>
<string>NameError</string>
<string>undefined</string>
<string>Exception</string>
</array>
</dict>
</plist>


Reply all
Reply to author
Forward
0 new messages