mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #197] 2.0 Code cleanups / tasks #64
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Seldaek on GitHub (May 21, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/197
Clean up arg orders of handlers that have had added args pushed at the end (after bubbling etc), maybe group them in an $options array or parameter objects? Needs RFC. Check #801 too about fluent settersfigure out how to handle network timeouts globally somehow, see #733Monolog\TestCaseto src/, see https://github.com/Seldaek/monolog/pull/356#issuecomment-40899938Split handlers w/ dependencies into packages i.e. http://php-and-symfony.matthiasnoback.nl/2014/04/theres-no-such-thing-as-an-optional-dependency/Change Logger constants to have RFC values (https://github.com/php-fig/log/issues/8)$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));) from Monolog\LoggerConsider adding a public method (send or write or so) on handlers to make reusing them out of monolog easier, c.f.github.com/Seldaek/monolog@f3b61cf48a (commitcomment-8237858)01549ec4d0androom_idandfromin buildContent (+nicknameeverywhere) should be removed. See if we can't detect the token format and warn users using a v1 token.php7 ideas:
possibly remove ErrorHandler::registerFatalHandler if this is not needed anymorethose items have been abandoned@stof commented on GitHub (May 21, 2013):
you should define
Monolog\Logger::API = 1now if you intend to bump it for 2.0, otherwise adjusting will require checking both if it is defined and equal to 2.@Seldaek commented on GitHub (May 21, 2013):
yup for sure, though that won't entirely prevent the need for a check,
but it should help
@rpkamp commented on GitHub (Aug 25, 2013):
Since we're talking about breaking BC anyway ...
I've always wondered why in
Logger::addRecordyou first check::isHandlingfor each of the registered handlers to find the first one that will be handling the message, and then iterate through all handlers from that point forward. Wouldn't a more logical implementation be:That way you only check once if a hander will handle a message, and then and only then give it the record. With the current version of the code all handlers need to call
isHandlingon themselves to see if they are actually handling the message. This to me seems the wrong place to check this.@Seldaek commented on GitHub (Aug 25, 2013):
There are a few things that influenced the existing code:
Since bubbling is rarely disabled and processors are also not very much used it seems, maybe one thing we could do at least is avoid calling isHandling if no processors are present. That would be BC and might make things a wee bit more efficient.
@DennisBecker commented on GitHub (Sep 16, 2013):
I think the "FingersCrossedHandler" has a bad name. I was looking something like "Backtrace" logger and just wanted to start to implement that for myself and then I have found the FindersCrossedHandler" in the docs.
I would appreciate to rename this handler to a more obvious name for those who first look into the source code and file names.
@Seldaek commented on GitHub (Sep 16, 2013):
@DennisBecker I feel your pain but frankly I doubt there is a short name that can convey clearly what it does to everyone. It's just a concept and as such Backtrace wouldn't be more clear to me and less fun so I'd say no. It's not strictly a backtrace since it also sends logs following an error for example.
@DennisBecker commented on GitHub (Sep 16, 2013):
@Seldaek I agree, backtrace doesn't fit better at all. It is more a kind of log message aggregation. That would better describe it from my point of view.
@adlawson commented on GitHub (Oct 21, 2013):
One thing that may be worth considering is the potential to limit the handlers contributed to the core library, and instead encourage contributions as a separate library.
The benefit of not including every handler under the sun is a reduced library size, and consumers can depend on the specific handlers they need.
I think, though, that it's a good idea to have a good selection of handlers in the core.
Just something to consider.
@Seldaek commented on GitHub (Oct 21, 2013):
@adlawson I'm generally all for pushing code into plugins, because I don't particularly enjoy having to maintain code I am not using and did not write. That said, in this case since most handlers have very little code it's not so bad on the maintenance side, and having them "blessed" here means higher code quality and consistency between handlers. At least I try to keep things that way, probably it's not 100%, but better than if there was a wild-west of plugin packages to choose from I think. So that's unlikely to change unless the amount of log backends becomes unmanageable.
@rpkamp commented on GitHub (Mar 19, 2014):
Maybe a better name for FingersCrossedHandler would be AllOrNothingHandler? It does convey what the handler does a little bit better. Although I personally still think FingersCrossedHandler is the best class name ever and does not need changing I can see that it can be confusing to newcomers.
@staabm commented on GitHub (Oct 14, 2014):
@Seldaek some LogHandlers have a plethora of parameters which make them really hard to use and read.
What do you think of introducing parameter objects with a builter pattern, to ease the config of handlers?
This would also ease the addition of even more parameters in the future, since you don't need to clutter the constructor anymore..
@Seldaek commented on GitHub (Oct 21, 2014):
@staabm might be enough to have a simple $options array as standard constructor param.. Not as self-documenting as the args but I agree in some cases it's getting a bit absurd.
@nackjicholson commented on GitHub (Oct 29, 2014):
@DennisBecker +1 For "FingersCrossedHandler" having a bad name. I wasted a couple hours building and testing my own handler which had the same functionality. I don't like my name for it either, but I named mine "TailingBufferHandler" because what I wanted to see from it was kind of like a linux
tailof contextual past logs from the point when the log of an appropriate severity was handled."FingersCrossed" sounds like a goofy ass database name, or the name of some quirky log service you've never heard of -- and that makes it extremely easy to overlook. Which is a shame, because it's awesome! Quite possibly the most useful handler.
@nackjicholson commented on GitHub (Oct 29, 2014):
Do you have a branch where you're targeting these changes to? I'd be willing to lend a hand on some of the low complexity ones like removing todos, and moving the
TestCaseto thesrcor atests-src/directory.@ChristianRiesen commented on GitHub (Jan 7, 2016):
Just a small side note on the naming FingersCrossed: The concept is close to tripping a fuse, a common pattern in flood avoidance code. BufferedFuse? FuseTripping? I'm not saying these are good, but maybe will inspire someone for a better one. Good naming will save a lot of time for many I think, just judging from how many already said here that they essentially started implementing it on their own as well.
@ZergMark commented on GitHub (Mar 3, 2016):
"Drop support for outdated mongo exts in MongoDBHandler" can be marked as done via #307.
Very Minor PHP 7 Ideas:
@rpkamp commented on GitHub (Dec 2, 2016):
Why was "Split handlers w/ dependencies into packages" crossed out? It seems like a good idea to me. At the moment if you want to develop for monolog and run all the tests to make sure you haven't broken anything you need to install a lot of dependencies, one of which I don't even have access to at all (Zend Server). If parts that need additional dependencies were to be split off of the main repository it would make developing a lot easier imo.
@stof commented on GitHub (Dec 2, 2016):
@ZergMark return types are used in several places already.
@moderndeveloperllc commented on GitHub (Dec 2, 2016):
@stof In my defense, there were quite a bit fewer uses back in March (@ZergMark is an older business account). :-)
@elazar commented on GitHub (May 23, 2017):
Potentially related to this and #903: a number of handlers are using the curl extension directly in conjunction with
Monolog\Handler\Curl\Utilfor interacting with third-party services:Support for environments without the curl extension could be possible by refactoring these handlers to use Guzzle instead.
@rpkamp commented on GitHub (May 23, 2017):
Instead of going for Guzzle I would consider HTTPlug instead so people can provide their own implementation.
@hkdobrev commented on GitHub (Mar 10, 2018):
I'd like to chime in on the old topic of
FingersCrossedHandler. Sentry has a concept exactly for that and they call it "breadcrumbs" - what notable events you went through prior to the exception. I'd suggestBreadcrumbsHandleras I think most people would get it right away and it fits the prior art of Sentry.@filips123 commented on GitHub (Jun 19, 2018):
What will be different between Monolog 1 and 2? Will existing code still work?
@staabm commented on GitHub (Jun 20, 2018):
The point of a new major version is mostly that it will break „some“ things, hopefully not too much
@Seldaek commented on GitHub (Jun 20, 2018):
Yeah the goal is to keep things working for end users apart from the configuration of the logger (which is mostly abstracted in other places/frameworks anyway). You can see https://github.com/Seldaek/monolog/blob/master/UPGRADE.md for the current listed BC breaks, the first two kinda affect regular usage.
@filips123 commented on GitHub (Jun 20, 2018):
What will be minimal PHP version? Bacause some systems like Ubuntu 14.04 and 16.04 don't have latest PHP version (7.2) in repositories. Also, many hosting are still using PHP 5.5.
@stof commented on GitHub (Jun 20, 2018):
@filips123 For now, it requires PHP 7.1+
@stof commented on GitHub (Jun 20, 2018):
and if you still need to support PHP 5.5, the solution is simple: keep using Monolog 1.x. It won't magically stop working the day 2.0 is released.