Jordi Boggiano
e07c948042
Merge branch '1.x', clean up close/reset for 2.0, refs #997
2018-11-04 22:41:52 +01:00
Jordi Boggiano
b80352368c
Add Logger::close and clarify what close and reset do plus
2018-11-04 22:15:25 +01:00
Jordi Boggiano
dddc7ed781
Fix some resettableinterface usages
2018-11-04 19:58:13 +01:00
Grégoire Pineau
0625068bf0
Added a new ResettableInterface and implemented it where possible.
...
When one use Monolog in a long process like an AMQP worker with a
`FingersCrossedHandler` or `BufferHandler` there is a drawback: as soon as there
is an AMQP message that generate a log >= error (for example), all next AMQP
messages will output logs, even if theses messages don't generate log where
level >= error.
In the same context there is a drawback for processor that add an UUID to the
logs. The UUID should change for each AMQP messages.
---
This patch address this issue with a new interface: `ResettableInterface` interface.
Side note: `reset()`, `flush()`, `clear()`, are already used in Monolog. So
basically, one can use the `reset()` on the `Logger` and on some
`Handler`s / `Processor`s.
It's especially useful for
* the `FingersCrossedHandler`: it `close()` the buffer, then it `clear()` the buffer.
* the `BufferHandler`: it `flush()` the buffer, then it `clear()` the buffer.
* the `UidProcessor`: it renew the `uid`.
2018-07-06 16:07:13 +02:00
Jordi Boggiano
06143b03e5
Add a bunch of return types and fix type inconsistencies reports from phan
2018-07-04 14:14:08 +02:00
Martin Meredith
a07a4c3741
Update Docblock to specify allowing string Log Levels ( #1068 )
2018-06-17 17:43:18 +02:00
Jordi Boggiano
bd7b28e5ee
Merge branch '1.x'
2018-06-07 18:49:40 +02:00
Erik Booij
ecdfdc9897
Rename Boolean in phpDocs to bool
2017-11-04 12:14:41 +01:00
Jordi Boggiano
21dde4dedb
Move to strict mode and fix tests
2016-05-27 13:44:00 +01:00
Filip Procházka
e2c575b505
Catch Throwable
2016-05-13 21:43:07 +02:00
Jordi Boggiano
6c424f851c
Add a lot more scalar types and go strict in Logger
2015-12-18 17:48:48 +00:00
Jordi Boggiano
902c0c8694
Split interfaces and base/abstract classes into more sensible pieces
2015-12-18 17:48:40 +00:00
Jordi Boggiano
3a41aa08c4
Docblock fixes
2015-12-18 17:48:21 +00:00
Jordi Boggiano
c889fb2648
CS fixes & upgrading cs fixer config
2015-11-18 17:09:46 +00:00
Jordi Boggiano
feb19af2d4
Add support for PSR-3 levels to all public APIs accepting levels, fixes #421
2014-09-30 13:59:45 +01:00
Jordi Boggiano
3926d95f8a
CS fixes
2013-12-26 11:43:12 +01:00
Jordi Boggiano
1518320bec
Clarify/fix bubbling docs, fixes #229
2013-09-02 12:24:25 +02:00
Jordi Boggiano
7a8844d4db
Fix CS and add chainability to a few more setter methods, refs #221
2013-08-09 14:12:38 +02:00
BilgeXA
bbf7f20b2a
Fluent interface for AbstractHandler::setFormatter()
2013-08-09 00:53:54 +01:00
Jordi Boggiano
da33c84d07
CS fixes
2012-06-14 15:47:01 +02:00
Mark Perkins
12f27c2b24
Remove extra spaces between braces.
2012-02-11 11:28:05 +00:00
Mark Perkins
5055102e88
Add try/catch block around call to close method in the AbstractHandler destructor.
2012-02-11 11:07:55 +00:00
Jordi Boggiano
cf4240cc51
Ensure processors are valid callables
2011-07-06 15:37:29 +02:00
Jordi Boggiano
66c1cc05a8
More testing coverage
2011-06-29 21:32:02 +02:00
Jordi Boggiano
c465a5dd02
Adjusted docblock
2011-06-29 18:24:58 +02:00
Jordi Boggiano
6a2d207f98
Bubbling defaults to true
2011-06-10 16:03:47 +02:00
Christophe Coevoet
0defabb726
Refactored the AbstractHandler to avoid having some dummy write() methods
2011-05-11 18:43:04 +02:00
Christophe Coevoet
6aebccf34c
Moved the use of the default formatter to the getter to keep the code DRY
2011-05-08 16:34:56 +02:00
Christophe Coevoet
7ebcc6420f
Changed the FormatterInterface to return only the formatted message and added a batch formatting method
2011-05-07 00:55:59 +02:00
Jordi Boggiano
ea466fa848
Removed second param from processors
2011-04-08 13:53:30 +02:00
Jordi Boggiano
0a09d83fb6
Make the AbstractHandler have proper default in case the constructor is overriden and not called
2011-04-06 13:59:00 +02:00
Christophe Coevoet
3cb3dbdc8f
Made the write method protected
...
Tests are not a good reason to make it public.
2011-04-06 13:22:06 +02:00
Christophe Coevoet
87332a3e4e
Added phpdoc for all methods and added the typehint for the FormatterInterface
2011-04-06 00:50:18 +02:00
Jordi Boggiano
3b0f738b88
Added docblocks
2011-04-05 22:35:39 +02:00
Christophe Coevoet
b2d356bbf2
Added a BufferHandler to allow batch processing of the records
2011-04-05 09:41:27 +02:00
Christophe Coevoet
3a3c96d6d7
Added some methods in the HandlerInterface and some typehints
2011-03-19 23:07:44 +01:00
Jordi Boggiano
6c24217c56
Renamed message to record
2011-02-25 23:01:43 +01:00
Jordi Boggiano
156e2ace46
Reorder processor stack
2011-02-25 22:01:37 +01:00
Jordi Boggiano
903bbd0fd6
Move the stack handling to the Logger class
2011-02-25 22:00:51 +01:00
Jordi Boggiano
811e6c79d6
Added docblocks and fixed a couple tests
2011-02-22 12:10:54 +01:00
Jordi Boggiano
a426ce2815
Added a Processor stack to the Logger class, added getHandler() to check if any handler is going to handle the message before processing it, handlers are now calling their parent in a chain
2011-02-21 20:38:18 +01:00
Jordi Boggiano
3fa6e4b91f
Major refactoring to follow the Logbook model
2011-02-20 20:53:11 +01:00