File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -951,16 +951,21 @@ private function getHandlerClassByType($handlerType)
951
951
952
952
if (Logger::API === 2 ) {
953
953
$ typeToClassMapping = array_merge ($ typeToClassMapping , $ v2HandlerTypesAdded );
954
-
955
954
foreach ($ v2HandlerTypesRemoved as $ handlerType ) {
956
955
unset($ typeToClassMapping [$ handlerType ]);
957
956
}
958
957
}
959
958
960
959
if (!isset ($ typeToClassMapping [$ handlerType ])) {
961
- if (array_key_exists ($ handlerType , $ v2HandlerTypesAdded )) {
960
+ if (Logger::API === 1 && array_key_exists ($ handlerType , $ v2HandlerTypesAdded )) {
961
+ throw new InvalidArgumentException (
962
+ sprintf ('"%s" was added in MonoLog v2, please upgrade if you wish to use. ' , $ handlerType )
963
+ );
964
+ }
965
+
966
+ if (Logger::API === 2 && array_key_exists ($ handlerType , $ v2HandlerTypesRemoved )) {
962
967
throw new InvalidArgumentException (
963
- sprintf ('"%s" was added in MonoLog 2, please upgrade if you wish to use . ' , $ handlerType )
968
+ sprintf ('"%s" was removed in MonoLog v2 . ' , $ handlerType )
964
969
);
965
970
}
966
971
You can’t perform that action at this time.
0 commit comments