Search code examples
visual-studio-codeloggingcolorsfocus

coloring log statements in vscode


I'm wondering if I can change the color of my log statements in my code. anyway to do it? I want them dimmer (kinda like comments) so that it won't be as distracting and I can focus more on my actual codes. I'm thinking somthing like how "better comments" extension works.

i.e: when I enter a keyword/symbol like: #^ <<<<<< LOG >>>>>> the next line becomes dimmer.

enter image description here

I can change the color of comments using "better comments" but I want to change the color of any arbitrary lines of code.

by the way I can do this using #region and #endregion:

enter image description here

but I prefer somthing more refined if possible.


Solution

  • I managed to work around it using "better comments".

            {
                "tag": "region#",
                "color": "#565185",
                "strikethrough": false,
                "underline": false,
                "backgroundColor": "transparent",
                "bold": false,
                "italic": true
            },
            {
                "tag": "endregion#",
                "color": "#565185",
                "strikethrough": false,
                "underline": false,
                "backgroundColor": "transparent",
                "bold": false,
                "italic": true
            }
    

    with this, I can fold my logging blocks and the color is dark enough, so it won't be as distracting as before.

    here's a screenshot: (both folded and expanded views)

    enter image description here