Skip to content
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

Make NullHandler handle 'bubble' argument #399

Closed
gggeek opened this issue Mar 29, 2021 · 2 comments
Closed

Make NullHandler handle 'bubble' argument #399

gggeek opened this issue Mar 29, 2021 · 2 comments

Comments

@gggeek
Copy link

gggeek commented Mar 29, 2021

It seems that the code is sending bubble config to Null handlers, but the code does not handle that.
This could be fixed eg. by making NullHandler child of AbstractHandler instead of Handler

See:

        // Handlers using the constructor of AbstractHandler without adding their own arguments
        case 'browser_console':
        case 'test':
        case 'null':
        case 'debug':
            $definition->setArguments([
                $handler['level'],
                $handler['bubble'],
            ]);
            break;

vs

    /**
     * @param string|int $level The minimum logging level at which this handler will be triggered
     */
    public function __construct($level = Logger::DEBUG)
    {
        $this->level = Logger::toMonologLevel($level);
    }
@gggeek
Copy link
Author

gggeek commented Mar 29, 2021

PS: thinking more about this: what is the use of a null logger if not to be used as 'blackhole'?

Maybe we could leave it as is, but make code more explicit about it never bubbling...

@gggeek
Copy link
Author

gggeek commented Mar 29, 2021

Ok, there is already a comment in the code that explicitly calls it a 'Blackhole'. I need moar coffee

@gggeek gggeek closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant