Much needed: well-highlighted JSON log viewer

前端 未结 7 927
感动是毒
感动是毒 2021-01-30 22:46

Using winston for node.js logging, I get json log files. A log file in this vein is simply a sequence of (newline delimited) json objects. This is great for log querying and tre

7条回答
  •  名媛妹妹
    2021-01-30 23:21

    looking at a json file in SublimeText, I realised keys and values have different scopes. so it should be very trivial to customize your color scheme and add different color for keys and values.

    keys have scope of source.json meta.structure.dictionary.json string.quoted.double.json while values have source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json

    so if you add this snippet at the bottom of you color scheme rules you should see them in different colors:

        
            name
            Json Keys
            scope
            source.json meta.structure.dictionary.json string.quoted.double.json
            settings
            
                foreground
                #FF0000 
            
        
        
            name
            JSON Values
            scope
            source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json
            settings
            
                foreground
                #00FF00 
            
        
    

提交回复
热议问题