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

Does not work for me - no syntax highlighting at all #14

Closed
bialix opened this issue Nov 24, 2016 · 16 comments
Closed

Does not work for me - no syntax highlighting at all #14

bialix opened this issue Nov 24, 2016 · 16 comments

Comments

@bialix
Copy link

bialix commented Nov 24, 2016

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

@emilast
Copy link
Owner

emilast commented Nov 25, 2016

Hi,

It should work right away, and yes, it associates with the .logfile extension. However, it sounds like the wrong colorizer is active, "vscode-output-colorizer" is not mine :-) If my mode is active, it should say Log File in the bottom right corner.

You can try to manually change formatter by typing:

1 Ctrl + Shift + P
2 Change Language Mode
3 Log File

Hope this helps.

Cheers,

Emil

@bialix
Copy link
Author

bialix commented Nov 28, 2016

That's unfortunate, because file "test.log" is automaticaly detected as log file and syntax highlighter automatically enabled. But it's not working for file name I quoted above. Can you check your filenames matcher please?

@emilast
Copy link
Owner

emilast commented Nov 28, 2016

Well, if it says "vscode-output-colorizer" in the bottom right corner then it sounds like my formatter is not active. Any file ending with *.log should be matched automatically. This is what it should look like:

image

If it does not look like this then my formatter is not active, but you may force it to be activated using the steps outlined above.

If your file still doesn't look highlighted, then maybe you're using a custom theme where the colors don't show? If you want, you can send me the file in question and I'll test it on my machine to see if it works.

@shivan
Copy link

shivan commented Nov 29, 2016

Hi,
I had the same problem here. It said: vscode-output-colorizer

Solution:
Uninstall Log File Highlighter. Close VS Code, start VS Code, install again. Reload VS Code. Now Log File can be selected on the bottom right.

Disable and enable again did not solve the problem.

But what persists: If I open i.e. "pentaho.log" it still opens vscode-output-colorizer.
I'm using "Dark Visual Studio" Theme.

@emilast
Copy link
Owner

emilast commented Dec 1, 2016

Okay, this is apparently starting to spread. Do you have any other extensions installed and enabled? Does disabling them help? I'm suggesting this just for narrowing the problem down, using other extensions is allowed ;-)

@emilast
Copy link
Owner

emilast commented Dec 1, 2016

@shivan and @bialix, are you by any chance using the Output Colorizer by IBM? It's a sibling to my extension (both are based on a Stack Overflow discussion I initiated before writing my extension) and their extension does indeed have an alias of vscode-output-colorizer. Disable that extension and I have a feeling that your log files will look okay again.

@shivan
Copy link

shivan commented Dec 5, 2016

@emilast I've got these extensions installed:

  • Copy Syntax
  • join-lines
  • Log File Highlighter
  • Python
  • Sort lines
  • Text Marker
  • XML Tools

That's all.

@emilast
Copy link
Owner

emilast commented Dec 7, 2016

@shivan, thanks for replying. This is really strange. Not sure what I can do as there seems to be some confusion about what colorizer to use for this file extension.

Does it help if you put this into your user settings file?

    "files.associations": {
        "*.log": "log"
    }

BTW, this is also how one would add additional file extensions to be viewed as log files.

@shivan
Copy link

shivan commented Dec 8, 2016

Hi @emilast

setting in my user settings

  "files.associations": {
          "*.log": "log"
    }

works, yes.

@emilast
Copy link
Owner

emilast commented Dec 8, 2016

Thanks, then we know it's a problem with the file associations. I can only assume that it's one of your other extensions that also associates with *.log but there are no obvious candidates in your list. If you disable one of them at a time then maybe you can isolate which one of them it is?

@emilast
Copy link
Owner

emilast commented Feb 9, 2017

I will close this now as it's possible to fix by explicitly associating log files to this extension in the user settings.

@emilast emilast closed this as completed Feb 9, 2017
@camilo0365
Copy link

image

Hello guys! I just found that Python is the one adding the "vscode-output-colorizer" to the installed languages. This to me does not make any sense, since the IBM Output Colorizer extension stops working. Will probably issue a bug in the Python extension.

@emilast
Copy link
Owner

emilast commented Oct 11, 2017

Thanks for reporting the issue with Python. I'll leave this issue closed as there's not really much I can do about it.

@steghio
Copy link

steghio commented Dec 28, 2020

Hello,

just wanted to add I had a similar problem, but the cause was a VS Code setting.

If the file being opened is too big, some functionality is disabled by default. You get a small popup prompting you to "Don't ask again" - BAD CHOICE, see microsoft/vscode#24815 - or "Forcefully enable ..." which is what you want to do, see microsoft/vscode#32508

If you choose to enable the features, then you need to restart and finally the logs will be highlighted.

I think this might be added to the doc

Cheers

@emilast
Copy link
Owner

emilast commented Mar 14, 2021

Thanks. The setting is called "editor.largeFileOptimizations". I'll add it to the docs in the next release.

@Hadatko
Copy link

Hadatko commented Dec 12, 2023

Hello. In my case the file is always detected as binary. Even i set default to log file and turn off optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants