File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33use Clockwork \DataSource \DataSource ;
44use Clockwork \Request \Log ;
55use Clockwork \Request \Request ;
6- use Clockwork \Support \Monolog \Monolog2 \ClockworkHandler as Monolog2ClockworkHandler ;
7- use Clockwork \Support \Monolog \Monolog \ClockworkHandler ;
6+ use Clockwork \Support \Monolog \Monolog2 \ClockworkHandler ;
7+ use Clockwork \Support \Monolog \Monolog \ClockworkHandler as LegacyClockworkHandler ;
88use Monolog \Logger as Monolog ;
99
1010// Data source for Monolog, provides application log
@@ -18,19 +18,7 @@ public function __construct(Monolog $monolog)
1818 {
1919 $ this ->log = new Log ;
2020
21- $ handler =null ;
22- switch (\Monolog \Logger::API ) {
23- case 1 :
24- $ handler =new ClockworkHandler ($ this ->log );
25- break ;
26- case 2 :
27- $ handler =new Monolog2ClockworkHandler ($ this ->log );
28- break ;
29- default :
30- // By default use the latest implementation of clockwork handler
31- $ handler =new Monolog2ClockworkHandler ($ this ->log );
32- break ;
33- }
21+ $ handler = Logger::API == 1 ? new LegacyClockworkHandler ($ this ->log ) : new ClockworkHandler ($ this ->log );
3422
3523 $ monolog ->pushHandler ($ handler );
3624 }
You can’t perform that action at this time.
0 commit comments