-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Log() or Debug() function #1459
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
Comments
So I'm tempted to start working on this as I know the functions are separated into a convenient I think the
This would print something like
Some additional work may be necessary for dealing with colours; Specifically how they should be displayed (hex, rgba, both, etc.) Any thoughts on this? |
I was able to get a simple pass through function working but ran into issues with the function not having access to debugInfo in order to get its line number. Additionally, the function is limited by only being able to be used in an expression. As such, I have decided to try introducing an
|
Btw., if you have
or even:
Though I'm not sure if it fits if you need to log specific statement line. |
@seven-phases-max It might work if you altered the trace do pass in a line number, which you would know from the editor. I'm not sure of the value of this natively. It really has nothing to do with style pre-processing. I think the responsibility lies with Less editing platforms to provide you with debugging tools. |
This is dependent on the root functions PR, but this should be trivial to do as a plugin once that work is completed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
What's the status here? |
As LESS frameworks become more common, it gets harder and harder to determine if complex calculations are being evaluated as expected.
I propose a debugging function that prints to either the node console during compilation or the browser console if being run in the browser. Something simple like the console.log() we're all familiar with. If
log()
is too close toMath.log()
then perhapsdebug()
is less ambiguous.Ideally, multiple values could be output at once and the line number the function was called on would be very useful.
The text was updated successfully, but these errors were encountered: