Giter Club home page Giter Club logo

vim-log-highlighting's People

Contributors

mtdl9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vim-log-highlighting's Issues

Highlights not applied to logs

Hi,

Thanks for this awesome work, I truly liked it. The problem is all log levels in my logs are highlighted with the same color. I tried to change in the log.vim but without success.

The columns in my logs are :

java-prod-agent - 09 17:51:58 ERROR [class] ............

ERROR, INFO, WARN, all have the same color.

Thanks.

Add ALE integration

Add a custom ALE checker, defined when the plugin is loaded and ALE is installed on the local VIM, that will mark all errors and warnings in the log file (using the error and warning keywords) and populate the location list.

This will allow displaying all the errors and jumping to them quickly using the location list functions/keybindings.

Might require converting the syn keyword definitions used for log levels into configurable variables.

logXmlEntity in log syntax has high cpu utilization on long hex values

Issue moved from sheerun/vim-polyglot#510

Does this bug happen when you install plugin without vim-polyglot?
No, it's the vim-polyglot syntax files.

Describe the bug:
Working with log files that contain json-encoded data, some of it rather long. When syntax highlighting is enabled, the following line (burried in a long log file) causes vim to sit at 100% utilization for more than a minute on vim7, and two seconds on vim8.

# the following line has 1220 byte string for data
I, [2020-07-08T14:41:34.438343 #15]  INFO -- service: { rc: 1220, errno: 0, data: '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' }

syntime report under vim8 with just that line:

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
  2.750524   9      0       2.750508    0.305614  logXmlEntity       \&\w\+;
  0.000460   9      0       0.000447    0.000051  logDate            \(\(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\) \)\?\(Jan\|Feb\|Mar\|Ap
  0.000221   1      0       0.000221    0.000221  logSysColumns      \w\(\w\|\.\|-\)\+ \(\w\|\.\|-\)\+\(\[\d\+\]\)\?:
  0.000160   9      0       0.000157    0.000018  logUUID            \w\{8}-\w\{4}-\w\{4}-\w\{4}-\w\{12}
  0.000134   22     13      0.000110    0.000006  logFloatNumber     \<\d.\d\+[eE]\?\>
  0.000133   27     19      0.000117    0.000005  logOperator        [;,\?\:\.\<=\>\~\/\@\&\!$\%\&\+\-\|\^(){}\*#]
  0.000131   12     3       0.000117    0.000011  logDate            \d\{2,4}[-\/]\(\d\{2}\|Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|
  0.000099   15     6       0.000093    0.000007  logHexNumber       \<\d\x\+\>
  0.000097   17     8       0.000086    0.000006  logNumber          \<-\?\d\+\>
  0.000080   1      0       0.000080    0.000080  logTimeZone        \d\{4} [A-Z]\{2,5}\>
  0.000075   9      0       0.000060    0.000008  logDomain          \v(^|\s)(\w|-)+(\.(\w|-)+)+\s
  0.000071   13     4       0.000052    0.000005  logTime            \d\{2}:\d\{2}:\d\{2}\(\.\d\{2,6}\)\?\(\s\?[-+]\d\{2,4}\|Z\)\?\>
  0.000058   9      0       0.000050    0.000006  logMD5             \<[a-z0-9]\{32}\>
  0.000057   9      0       0.000054    0.000006  logIPV6            \<\x\{1,4}\(:\x\{1,4}\)\{7}\>
  0.000054   9      0       0.000049    0.000006  logFilePath        [^a-zA-Z0-9"']\@<=\/\w[^\n|,; ()'"\]{}]\+
  0.000051   9      0       0.000049    0.000006  logHexNumber       \<0[xX]\x\+\>
  0.000051   9      0       0.000050    0.000006  logBinaryNumber    \<0[bB][01]\+\>
  0.000047   9      0       0.000045    0.000005  logIPV4            \<\d\{1,3}\(\.\d\{1,3}\)\{3}\>
  0.000047   9      0       0.000043    0.000005  logMacAddress      \<\x\{2}\(:\x\{2}\)\{5}
  0.000046   9      0       0.000043    0.000005  logFilePath        \<\w:\\[^\n|,; ()'"\]{}]\+
  0.000035   13     4       0.000030    0.000003  logBrackets        [\[\]]
  0.000024   1      1       0.000024    0.000024  logString          $
  0.000015   26     17      0.000002    0.000001  logString          '\(s \|t \| \w\)\@!
  0.000008   9      0       0.000002    0.000001  IndentLineSpace    ^\s\+
  0.000006   9      0       0.000004    0.000001  logEmptyLines      -\{3,}
  0.000005   9      0       0.000004    0.000001  logEmptyLines      - -
  0.000005   9      0       0.000004    0.000001  logString          "
  0.000005   9      0       0.000004    0.000001  logXmlDoctype      <!DOCTYPE[^>]*>
  0.000005   9      0       0.000003    0.000001  logXmlComment      <!--
  0.000005   9      0       0.000005    0.000001  logXmlCData        <!\[CDATA\[.*\]\]>
  0.000004   9      0       0.000004    0.000000  logEmptyLines      \*\{3,}
  0.000004   1      1       0.000004    0.000004  logString          '
  0.000004   9      0       0.000003    0.000000  logXmlHeader       <?\(\w\|-\)\+\(\s\+\w\+\(="[^"]*"\|='[^']*'\)\?\)*?>
  0.000004   9      0       0.000003    0.000000  logXmlTag          <\/\?\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(\(\n\|\s\)\+\(\(\w\|-\)\+:\
  0.000003   9      0       0.000003    0.000000  logEmptyLines      =\{3,}
  0.000003   1      0       0.000003    0.000003  logString          \\.
  0.000003   1      0       0.000003    0.000003  logString          s
  0.000003   1      1       0.000003    0.000003  logTimeZone        [A-Z]\{2,5}\>\( \d\{4}\)\?
  0.000003   9      0       0.000003    0.000000  logUrl             http[s]\?:\/\/[^\n|,; '"]\+
  0.000002   9      0       0.000001    0.000000  logDate            ^20\d\{6}

  2.752742   377

To Reproduce:

  • write the line to test.log
  • vim test.log

Dates not highlighting correctly

RFC 3339 dates and times are not highlighted correctly, and some ISO 8601 formats aren't, either.

Examples of issues in vim-log-highlighting_test.log, shown in the screenshot below:

  • RFC 3339 dates and times, with days and parts of years highlighted incorrectly, on lines 5, 10 and 19
  • ISO 8601 date and time, with the time zone highlighting truncated, on line 14

vim-log-highlighting_screenshot

error with a 's' at the end of the word

Hi,
I use your great plugin.
But little bug don't show correctly the colors

Ex:
msg:'test test' work great
but
msg:'tests test' not show the right color after the first word 'tests'
If a word end with a 's' color is interupted

What can we do?

Syntax highlighting inspiration from ccze rules

Hi! Thanks for this. I have a suggestion - I'm used to using ccze as a command line syntax highlighting post processor - i.e. 'cat /var/log/syslog |ccze -A'

It does some things I really like that I'd love to see in your plugin. Maybe you can get some inspiration from their highlighting rules. If I have some time, I may work on this myself.

You can see the ccze syntax highlighting rules here: https://github.com/cornet/ccze/blob/da40b194db910de610faccbabe559ed79c0b4411/src/ccze-color.c

Thanks again!

Add syntax highlighting for host-name, program and process number in syslog/messages logs

On Linux systems the syslog/messages format is commonly used in several system logs under /var/log.

This log format has five main sections:

  • date and time
  • host-name
  • program
  • optional process number
  • log message

Special rules should be added to highlight the host-name, program and process number sections.

Example of log data

Apr  3 07:40:01 HOSTNAME anacron[1111]: Job `cron.weekly' started
Apr  3 07:40:02 HOSTNAME rsyslogd: [origin software="rsyslogd"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.