Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting of additional log files #1466

Open
asins opened this issue Apr 1, 2023 · 1 comment · May be fixed by #1467
Open

Highlighting of additional log files #1466

asins opened this issue Apr 1, 2023 · 1 comment · May be fixed by #1467
Labels
request feature requests from users syntax highlight issues related to syntax highlighting

Comments

@asins
Copy link

asins commented Apr 1, 2023

Is your feature request related to a problem? Please describe.
The editor lacks syntax highlighting for .log files.

Describe the solution you'd like
I would like to incorporate highlighting for certain content such as dates, times, property names and values in JSON formatted data, syntax errors, and character highlighting for log levels such as INFO/WARNING/ERROR/DEBUG.

Describe alternatives you've considered
None

Additional context
image

Document Content
Log.yml Document Content:

attributes:
- beginString: (?<= )\d{2}:\d{2}:\d{2}\.\d{3}(?= )
  regularExpression: true
characters: []
commands:
- beginString: System.err:[^\n]+\n
  regularExpression: true
commentDelimiters: {}
comments: []
completions: []
extensions: []
filenames: []
interpreters: []
keywords:
- beginString: ^(?:\d{2}|\d{4}-)?\d{2}-\d{2}
  description: date
  endString: ' '
  ignoreCase: false
  regularExpression: true
metadata:
  author: Asins
  lastModified: '2023-04-01'
  version: '1.0'
numbers: []
outlineMenu: []
strings: []
types:
- beginString: (?<= )(?:D|DEBUG|Debug)(?= )
  regularExpression: true
- beginString: (?<= )(?:E|ERROR|Error|Err)(?= )
  description: 日志级别
  regularExpression: true
- beginString: (?<= )(?:I|INFO|Info)(?= )
  regularExpression: true
- beginString: (?<= )(?:W|WARN|Warn|WARNING|Warning)(?= )
  regularExpression: true
- beginString: \[(?:WARN|INFO|ERROR)(?::[^\]]+)?\]
  ignoreCase: false
  regularExpression: true
values: []
variables:
- beginString: '"[\w\d-]+"(?=:\s*")'
  description: JSON属性名
  ignoreCase: true
  regularExpression: true
- beginString: (?<=":)".*?(?<!\\)"(?=[},])
  description: JSON属性值为字符串
  regularExpression: true
- beginString: (?<=":)\d+(?=[},])
  description: JSON属性值为数字
  regularExpression: true
@asins asins added the request feature requests from users label Apr 1, 2023
@1024jp 1024jp linked a pull request Apr 1, 2023 that will close this issue
@1024jp
Copy link
Member

1024jp commented Apr 1, 2023

Thank you for the feedback and PR.
However, I suppose the extension .log is not for a specific file format but can be used for multiple types of log-like text file.
Therefore, it might not be relevant to bundle it into CotEditor itself.
It would be better to share it separately for the users who need this format.

@1024jp 1024jp added the syntax highlight issues related to syntax highlighting label Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request feature requests from users syntax highlight issues related to syntax highlighting
Development

Successfully merging a pull request may close this issue.

2 participants