Search code examples
asp.netcssconsolelessdotless

Log .less errors to console


Each time I have a .less syntax error I have to open the exact less file in browser in order to view the error message.

I was wondering if it is possible to somehow output .less errors to console so I can view all errors directly in the Console log when - for example - using Firebug?

I'm using dotless. I tried setting the webconfig to (by following info this link )

<dotless minifyCss="false" cache="false" web="false" log="error" logger="dotless.Core.Loggers.ConsoleLogger" />

but seems like I'm missing something - not really sure, if I understand the logger correctly.

Also the info about logger on the site states:

Can be set but then gets overidden by the "web" boolean

Does this mean that I must not set the web boolean? How could I make this work?


EDIT AFTER FEW ANSWERS

Ok so I figured out that in order to achieve this result I need to extend dotless.Core.Loggers with my own logger class. Have no idea how to do it but will report back once I get it figured out.


Solution

  • If you're using Visual Studio, you can try using Web Essentials extension, which is free on the gallery. This add-in compiles .LESS on save, and gives you the errors in the output console. You can also see the compiled .css side-by-side as as you edit the .LESS.