001/** 002 * Logback: the reliable, generic, fast and flexible logging framework. 003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved. 004 * 005 * This program and the accompanying materials are dual-licensed under 006 * either the terms of the Eclipse Public License v1.0 as published by 007 * the Eclipse Foundation 008 * 009 * or (per the licensee's choosing) 010 * 011 * under the terms of the GNU Lesser General Public License version 2.1 012 * as published by the Free Software Foundation. 013 */ 014package ch.qos.logback.classic.pattern; 015 016import java.util.HashMap; 017import java.util.Map; 018 019import org.slf4j.Marker; 020 021import ch.qos.logback.classic.spi.ClassPackagingData; 022 023/** 024 * 025 * @author Ceki Gulcu 026 */ 027public class Util { 028 029 static Map<String, ClassPackagingData> cache = new HashMap<String, ClassPackagingData>(); 030 031 static public boolean match(Marker marker, Marker[] markerArray) { 032 if (markerArray == null) { 033 throw new IllegalArgumentException("markerArray should not be null"); 034 } 035 036 // System.out.println("event marker="+marker); 037 038 final int size = markerArray.length; 039 for (int i = 0; i < size; i++) { 040 // System.out.println("other:"+markerArray[i]); 041 042 if (marker.contains(markerArray[i])) { 043 return true; 044 } 045 } 046 return false; 047 } 048 049}