Open stof opened 3 years ago
Note that I'm not using the bundle myself. However, as one of the maintainers of scssphp, I still find it interesting that the bundle that comes out on packagist when searching for scssphp respects the best practices about this reporting (i.e. making sure they are not hidden)
Those method calls (called in \Armin\ScssphpBundle\Scss\Job::execute
) are marked as deprecated:
setVariables
setFormatter
compile
I guess you mean using the CompilationResult
, right?
there is an official extension point to customize the reporting of sass warnings
apparently it's not CompilationResult
. Do you have a link to docs for me? Or an example? @stof
The reporting of Sass warnings is handled by the LoggerInterface. See https://scssphp.github.io/scssphp/docs/extending/ for the doc about extension points.
Okay, I've checked the LoggerInterface, but I think this is nothing I need to implement, because I am not using monolog at all, currently.
Errors and warnings occuring during compiling process, are already fetched, by catching \ScssPhp\ScssPhp\Exception\SassException
. All infos are displayed in debug toolbar, if installed. Or in CLI command, always.
The old calls of deprecated scssphp methods, are fixed. Thanks for helping!
Sass warnings are not triggering a SassException (otherwise, they would not be warnings as an exception interrupts the compilation). Sass warnings are reported through the Scssphp LoggerInterface (which is not related to Monolog). To me, you would need a custom implementation of that interface to collect the warnings to render them in the webprofiler, instead of using the default one sending to to STDERR.
Okay, I got it!
@stof Maybe, this would be a nice addition for scssphp's api too. A memory log writer.
As of scssphp 1.5, there is an official extension point to customize the reporting of sass warnings.
Reporting them in the profiler might be an option.