-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
monolog-discord-handler pulls a version of GuzzleHttp incompatible with other plugins #4
Comments
Ironically, this dependency is pulled by: Let alone the fact that it's loaded even though I don't even configure this handler. The workaround is simple: By the way, given the comment on grav-plugin-login-oauth2#41 it's very important that each plugin dependencies be restricted to a minimum. |
This is indeed a problem, as mahagr pointed out already. I have no real chance of loading dependencies only if they are configured. An idea would be to have I will try to get a poc working this weekend and let you know how to build the graylog handler addon plugin yourself. This would be a much smoother workflow for all of us, because you have the tools and setup to test graylog properly. |
I will think about this again. Maybe it is better to implement such handlers, that require additional dependencies, ourselfs. As far as I know the "addon pattern" is not officially supported by the grav core team and therefore not really reliable. |
Multiple plugins/projects is a developing/maintenance pain and still seem overkill.
|
I am not quite sure what you mean with gpm hook or flags. The package manager basically just downloads the plugin and puts it in the right folder. There is not much to configure. It also needs to be compatible with admin. Autoloading stuff only if its needed is a nice optimization, but does not solve the problem. I aggree with you, that maintaining multiple plugins is a pain. So I will try to easily implement the handlers myself to reduce the external dependencies. They are super simple to implement. This will solve the problem once and for all. |
This is the autoload:
Maybe the Since neither composer nor gpm allows package's "flavors", another distribution/packaging-based solution would be to create various plugin pointing to different branch of this very repository (then it's up to the GPM repository manager to see whether it's acceptable or not). I think any of these would be a more long-term solution than reimplementing the handlers by hand (which means much more unaudited custom bundled code that'd hardly match latest upstream changes/bugfixes). The Gelf handler is far from obvious btw. Please note that GPM also allow to install from a zip file URL (which, in this case, is handy to use a custom fork's zip file) |
I won't tweak around in an auto generated composer file. This is so far from stable and long-term. And again, this does not solve the problem, maybe for your usecase, but not for the plugin itself. You want to get rid of the discord handler, I get this, but I need to implement the discord handler to not use external dependencies. Trust me, its not the grav way to autload anything based on configuration. This would be super experimental and not stable at all. Maybe in the future grav will support something like this, but at the moment they don't. |
I created a simple Discord handler: https://github.com/stephan-strate/monolog-discord |
Thanks for reporting the issue :) |
Got
Call to undefined method GuzzleHttp\Utils::chooseHandler()
at user/plugins/logger-channels/vendor/guzzlehttp/guzzle/src/functions.php:61Related to bundling the libraries instead of using Grav's ones: Apparently, when loaded after login-oauth2 plugin (which bundles guzzlehttp/guzzle 6.5.4), the autoload is messed up and subsequent
GuzzleHttp\Utils
references are the one to the old version, missingchooseHandler
.The text was updated successfully, but these errors were encountered: