Closed rantonmattei closed 9 years ago
Overall LGTM. R+ (one question, but it's not blocking.)
would be curious to know the answer to the registry clearing question posed by Michael above...
R+
I need to refactor the Monologger
class a bit cause I realized there is no need to extend the \Monolog\Logger
class. I'm going to get rid of the constructor and write a factory method instead. It would check the registry to see if the named logger is there and if not will instantiate a \Monolog\Logger
object and push it to the registry. I'm thinking of renaming that class too. Maybe just Logging
so the full namespace would be \Cascade\Logging
.
Thanks for the review guys
I had to group those 3 cause
MonoLogger
uses the config class and theLoggerLoader
instantiates theLogger
object usingMonoLogger::getLogger()
So, here is what this does:
LoggerLoader
: like the other loaders it reads theloggers
config section and instantiates a\Monolog\Logger
object and adds the corresponding handlers to itConfig
: it is the main Cascade config class. It coordinates the sequence of loading the different components and pass thing around like passing Formatters to theHandlerLoader
and passing Handlers to theLoggerLoader
MonoLogger
is the interface to trigger the config loading (using thefileConfig
method). So, it is calling the config class to load a resource, then loaders kick in and take care of all the complex stuff (resolving params, etc). AdditionallyMonologger
populates the\Monolog\Registry
so we can access our configured loggers from anywhere usingMonologger::getLogger
(might write a alias to shorten that up, any idea?L::og('some_logger')
??L::get('some_logger')
?MonoLogger::get('some_logger')
)?@mortaliorchard @OrCharles
That's all folks! (in term of code...)