File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 33
44namespace MonoProcessor \Processors ;
55
6- use Monolog \Logger ;
6+ use Monolog \Processor \ ProcessorInterface ;
77
8- abstract class AbstractProcessor
8+ abstract class AbstractProcessor implements ProcessorInterface
99{
10- private $ level ;
11-
10+ private $ config ;
11+
1212 /**
1313 * @param string|int $level The minimum logging level at which this Processor will be triggered
1414 */
15- public function __construct ($ level = Logger:: DEBUG )
15+ public function __construct ()
1616 {
17- $ this ->level = Logger:: toMonologLevel ( $ level );
17+ $ this ->config = $ this -> getConfig ( );
1818 }
19-
19+
2020 public function isWrite ($ level_name )
2121 {
2222 return in_array ($ level_name , ['ERROR ' ,'EMERGENCY ' ]);
2323 }
24+
25+ private function getConfig () : array
26+ {
27+ $ config = app ()['config ' ]['mono-processor ' ];
28+
29+ return empty ($ config ) ? [] : $ config ;
30+ }
2431}
You can’t perform that action at this time.
0 commit comments