Isn't type == level here? This will give errors for each level that does not have an explicit logger set.