emilast / vscode-logfile-highlighter Goto Github PK
View Code? Open in Web Editor NEWA Visual Studio Code extension for color highlighting log files
License: MIT License
A Visual Studio Code extension for color highlighting log files
License: MIT License
Hello,
I do the entity framework and in the log when a sql request fails, the word "Failed" is used.
Would it be possible to add this word into the log level?
Thank you.
Currently, not all ISO dates (https://www.w3.org/TR/NOTE-datetime) are highlighted correctly.
Examples:
1994-11-05T08:15:30-05:00
1994-11-05T13:15:30Z
It seems like the extension matches log levels with a case-sensitive comparison. Nlog instead uses Camelcase log levels, such as "Error", "Info" and so on.
The current red color is too strong and attracts too much attention.
I tested and found that if I disable the CMake Tools and then reload vscode, the logfile-highlighter can works fine. They all create a toolbar bellow vscode, maybe this lead them conflict each other, I guess.
Hope this information is useful for you.
Some colors never show, like the INFO / WARN / ERROR words.
It's probably not understanding info-token / warn-token / error-token anymore.
PS1: I tried all themes.
PS2: My log is generated by winston-logger for nodejs. But I also tried in your syntax.
when opened up a long log file (5000line). The log color is flashing between plain and colored. Short logs flash too but only for 2-3 times and it stops.
Version: 1.1.1
changed theme and turn off minimap won't help.
I have add
"files.associations": {
"*.log.*": "log"
}
to setting
Example:
00:00:04.4010087
00:00:04,4010087
Awesome tool.
Unfortunately it cannot recognize GUID correctly. It colorizes only the parts that are completely number.
E.g. if the log line contains:
ParamId=70afd445-5948-4597-9951-373d336e1627
then the colorized parts are only (bold):
ParamId=70afd445-5948-4597-9951-373d336e1627
but it should be
ParamId=70afd445-5948-4597-9951-373d336e1627
or none.
This doesn't seem to work with large log files.(ex: 200,000 lines) Any chance this will be supported in the future?
Dear sir ,
Can we custom the date format by our own, or add this date format in this plug-in, please.
Thank you.
Add color for "abc.cde.fgh".
Hello,
I have huge log files (835k+ lines) and this extension seems not to work with big files.
Is there a reason for this ?
Hi, Thank for the create great extension and custom highlight.
I would like to suggest feature to apply default highlight after custom highlight
Example
As you could see that the custom highlight is work perfectly but you could see the last digit 3 at the end is not highlight by the default color any more like the ones above it.
I would like to ask for either another entry in VSCode settings that would be painted before the default or attribute of custom patterns that for the same purpose
"logFileHighlighter.customLowLevelPatterns": [
{
"pattern": "\\* START \\*.*",
"foreground": "teal"
}
]
or
"logFileHighlighter.customPatterns": [
{
"pattern": "\\* START \\*.*",
"foreground": "teal",
"lowLevel": true
}
]
I'm using VS Code, but not the extension.
Can the time format be expanded? (just a tiny bit)
DOS TIME (%TIME%) typically outputs (h| )h:mm:ss.ms
. This is an example from echo %DATE% %TIME%-
07/03/2018 0:15:05.49-
There is a space in place of where the extra 0 for the hour should be.
If the time format could be expanded through the following change, I bet it would help others too.
\d{1,2}:\d{2}(:\d{2}([.,]\d{1,})?)?(Z| ?[+-]\d{2}:\d{2})?\b
Changes: 1 or 2 (instead of only 2) digits before the first ':', at least 1 (instead of at least 3) digits after a .
or ,
. (I have seen logs that only included 100ms resolution, ie hh:mm:ss.m)
Thanks.
It looks like your code was integrated to the VS Code 1.20.0 release:
"Now you can see VS Code logs with syntax highlighting in the Output panel. Thanks to emilast for providing the grammar for syntax highlighting log files."
Does that mean your extension is now deprecated? Or does it provide more?
Hi, great extension, thanks for supporting it.
I'm using the NodeJS Winston logging tool and it has some additional logging levels.
It would be great to be able to be able to specify additional log levels and other string tokens. I would, for example, like to be able to colour "Verbose" or "VERBOSE" in green.
For example, 93033793-afde-42a4-9637-0d283b64ccbe
is not correctly colored since the first part is analyzed to be an integer and is colored accordingly.
It only works with uppercase characters.
I tried to install using Code Insiders version but received this error message:
Couldn't find a compatible version of Log File Highlighter with this version of Code.
Are there plans to make it compatible with the Insiders version?
Thanks,
Derek
Here is my version:
[Window Title]
Visual Studio Code - Insiders
[Main Instruction]
Visual Studio Code - Insiders
[Content]
Version 1.6.0-insider
Commit 602155bb781f509c7a4ddcd700b57cb9b9f5286d
Date 2016-10-01T00:36:55.469Z
Shell 1.3.7
Renderer 52.0.2743.82
Node 6.5.0
[OK]
Cannot install. Not compatible version with vscode 1.6
Compare with the vscode-ext-color-highlight plugin for a solution.
If these words, followed by a colon, occurs in a log file they will likely be interesting to highlight.
Example:
2017-01-11T15:47:53.643Z - error: Error during processing request: http://localhost:5488/api/report details:
Examples:
C:\foo\bar.txt
\\unchost\foo\bar.txt
Hi,
Great extension, I use this every day. Do you think it would be possible to add some functionality to follow a log as its being updated?
Perhaps this can be bound to a short cut to turn the follow on and off.
VS Code already auto updates the file as the log is being written to, the feature would basically keep the view scrolled to the bottom.
If there were some indication that the file had reloaded that would be fantastic too, perhaps a glyph in the gutter showing the last line when the tab was last active / last being viewed.
We often face logs of windows upgrades or migrations which all have those "keys" for their outputs:
2018-02-05 14:44:48, Warning MIG Could not create object Microsoft-Windows-Update-Ux-MusScnHandlers[@version="10.0.15063.850" and @arch="amd64" and @culture="neutral" and @context="perUser"]/settings. Exception class Mig::SideAwareWin32Exception: The request is not supported. [0x00000032] void __cdecl Mig::CStateDataStore::Create(class Mig::CDataUnit *)
2018-02-05 14:44:48, Info MIG Error 50 during apply of object Microsoft-Windows-Update-Ux-MusScnHandlers[@version="10.0.15063.850" and @arch="amd64" and @culture="neutral" and @context="perUser"]/settings. Will ask shell application for resolution.
2018-02-05 14:44:48, Warning SP Error WRITE, 0x00000032 while gathering/applying object: State, Microsoft-Windows-Update-Ux-MusScnHandlers[@version="10.0.15063.850" and @arch="amd64" and @culture="neutral" and @context="perUser"]/settings. Will return 2
2018-02-05 14:44:48, Info MIG Error 50 while applying object Microsoft-Windows-Update-Ux-MusScnHandlers[@version="10.0.15063.850" and @arch="amd64" and @culture="neutral" and @context="perUser"]/settings. Shell application requested ignore
2018-02-05 13:36:39, Error CONX Windows::Compat::Appraiser::WicaApplicationInventory::AddItemProperty (546): App Inventory returned duplicate file d:\users\aha\appdata\local\temp\~nsu.tmp\cu_.exe.[gle=0x8007000d]
2018-02-05 13:36:39, Error CONX Windows::Compat::Appraiser::WicaApplicationInventory::AddItemProperty (546): App Inventory returned duplicate file c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\devenv.exe.[gle=0x8007000d]
Could you please add this?
TIA, Andi
Wrong token name for exception type names...
How can I disable the path and url highlighting?
I have created a simple log interface as follows
2018-08-29 10:27:56 INFO Finish .test
2018-08-29 10:27:56 INFO Finish .lint:js-fix
2018-08-29 10:27:56 INFO Finish .lint:js
2018-08-29 10:27:56 INFO Finish .lint
2018-08-29 10:27:56 INFO Finish .test:unit
2018-08-29 10:27:56 INFO Finish .build
But when I view the log file in VSCode, it does not have formatting as it appears in your screenshots?
Is this because the date format is different?
Here is a screenshot of what I see
Must I need to configure the various colors myself, or are there sensible defaults (I am fine with the appearance of your screenshot)
It would be great, to have a feature to calculate the duration of the selected text...
Example:
I select this:
2016-11-25 12:03:50,659 WARN [org.pentaho.platform.web.http. ......
.....
....
2016-11-25 12:06:52,859 WARN [org.pentaho.platform.web.http. ......
Then the tool would show me in the status bar:
Selected: 3 Minutes, 2 Seconds, 200ms
This would be good for performance analysis.
So you have to search the first timestamp text at start of selection and the last one. Then calculate the difference and show it in the status bar.
Example: 2017-01-11T15:26:11.803Z
We only match up to 3 digits as it is now.
Example: 00:00:05.3989789
For example, in Solarized Dark almost no coloring is visible in log files.
Selecting this line shows a negative time duration:
2018-04-15 00:32:16 should not be compared to 2018-04-14 00:32:56
We should probably only match dates at the beginning of lines.
Some logs files already have ANSI coloring on them and it would be great it this extension would be able to deal with them instead of displaying the ugly ANSI escapes.
Often daily logs are used, which means that it's not feasible to include the date for every record. Please support detecting of records that start with something like
09:20:00.390
@emilast I am a developer from VS Code. In last release (1.19) we added support for logging in VS Code. As a result of this VS Code generates log files which will be shown in Output channel and also can be opened in the editor.
Now, we want to support syntax highlighting for these log files out of the box. I was looking for any existing syntax grammar for log files and I came across yours. So I would like to have following requests for you:
Can we reuse your grammar files for highlighting log files? We will update whenever you have fixes or enhancements
I see your extension is also doing the same. May I know if you are planning to add more functionalities to your extension other than highlighting? Not sure it is useful to have two things providing same feature.
Thanks
I use these command often for "group" logging output. I would like to be able to colorize these log types as well.
Would you consider adding log.header
and log.footer
If you are keen to allowing these commands, I would be happy to submit a PR for it (if you are too busy)
Thanks in advance for your consideration
Here is a sample of my log with these items
2018/09/10 14:27:40 PM HEADER ==> starting process
2018/09/10 14:27:40 PM INFO Start build
2018/09/10 14:27:40 PM INFO Finish build
2018/09/10 14:27:40 PM FOOTER ==> ending process
2018/09/10 14:27:45 PM HEADER ==> starting process
2018/09/10 14:27:45 PM INFO Start test:script
2018/09/10 14:27:45 PM INFO Finish test:script
2018/09/10 14:27:45 PM FOOTER ==> ending process
I've installed your extension recently in VS Code. Unfortunately it does not highlight log files at all. When I open log file there is no attempt to colorize it. I suspect that's because your plugin somehow does not try to work right away?
In bottom right corner I see label "vscode-output-colorizer". When I clik there I can select other syntax, I select "log" and only then I get highlighting. But selecting "log" for every file I open - very tedious, and that means I won't use your extension.
Just to be clear: file name is (just for example) "2016-11-22_09-07-38-worker-3511.log" - it has ".log" extension, right?
Will be nice to have it working though.
VS Code 1.7.2
Windows 7 SP1
Hi,
I contacted the dev who created Atom One Dark theme because of some color issues but I think the issue is in Log File Highlighter so I will try here instead.
WARNING syntaxes in .log files is shown as red color but ERROR messages is shown as GREEN.
If I disable Log File Highlighter and only enable the theme it looks like this:
Is it possible to fix change the ERROR syntax so it is the same color as WARNING so I can use it together with the theme?
Thanks for your work, this plugin is very useful.
Now I want to highlight lines that begin with "D/" or "E/", my customPatterns config is as below:
"logFileHighlighter.customPatterns": [
{
"pattern": "D/.+",
"foreground": "black"
},
{
"pattern": "E/.+",
"foreground": "red"
}
]
You can find that D/.+
not means 'the beginning of text is D/
', because I don't use ^
in pattern.
I try ^D/.+
or \\^D/.+
, but all didn't work.
How should I use ^ in customPatterns? Thank you.
First, there is in general onother culture format for time for example 2016-10-25 12:21:08.340 the delimiter is not always comma.
Second, something like
[2016-10-25 12:21:17.105] Process: w3wp |Organization:2c451fe8-4e66-e311-b2c1-005056806411 |Thread: 11 |Category: Platform.Sql |User: b6da5baa-6c53-4c0d-81e2-0d0ec3b5f58c |Level: Error |ReqId: 9b2b1b3a-b532-4d51-8c9f-22045c47b2ae | BusinessProcessObject.ExecuteQuery ilOffset = 0x4A
Does not match the log levels althought Error is in there as a single word. Do you only check on all caps?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.