contao icon indicating copy to clipboard operation
contao copied to clipboard

Use a separate channel for Contao deprecations

Open leofeyer opened this issue 3 years ago • 2 comments

As you see, there is a way to specify a channel for deprecations. We should probably do this for Contao deprecations, so people can easily see what they need to update in their extensions. @contao/developers WDYT?

monolog:
    handlers:
        deprecation_stream:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%-deprecations.log"

        deprecation_filter:
            type: filter
            handler: deprecation_stream
            max_level: info
            channels: ["php"] # <-- Here is where you can select which channels you want to log

leofeyer avatar Mar 17 '21 15:03 leofeyer

Good idea! I guess we can't determine what package triggered the deprecation? Something like debug_backtrace one class and check it's namespace (maybe just in debug mode)? 😅

aschempp avatar Mar 17 '21 15:03 aschempp

It's actually pretty complicated to understand and I also figured, it would be great if developers did not have to worry about registering own channels themselves and Symfony could just do it out of the box. So I proposed some automated extraction logic which would work for all Composer packages, not just Contao 😊 https://github.com/symfony/symfony/pull/42322

Toflar avatar Jul 29 '21 17:07 Toflar