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

why does direct echo in processing? #31

Open
andares opened this issue Nov 17, 2018 · 3 comments
Open

why does direct echo in processing? #31

andares opened this issue Nov 17, 2018 · 3 comments

Comments

@andares
Copy link

andares commented Nov 17, 2018

no debug mode, just echo. You will forced wrap a ob cache to flush echo message when call it in controller.

why do that? I never see a lib force run echo.

@jjok
Copy link
Contributor

jjok commented Nov 18, 2018

Yes, that's just debug information. I was already thinking about removing it. Or we could could add some kind of logger to handle it.
I'd be happy to just remove it for now.

@oliverlorenz
Copy link
Owner

Feel free to create a PR for that :slightly_smiling: This would be huge improvement for the library.

I wouldn't just remove the echo. To make it right is not that hard, right?

My favourite would be to have logger as optional dependency passed into library. So you are free to choose what ever you want. I remember there was this PSR-3 standard. Is this still the way to go?

@andares
Copy link
Author

andares commented Nov 20, 2018

In simple way, you can make a logger callback, and default choose echo in factory.

$client = ClientFactory::createClient(new Version4(), $dns, function ($msg) {
    echo $msg;
});

// user custom
$client = ClientFactory::createClient(new Version4(), $dns, function ($msg) {
    Log::debug($msg);
});

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

3 participants