View Javadoc

1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 2000-2008, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.classic.pattern;
11  
12  import java.util.HashMap;
13  import java.util.Map;
14  
15  import org.slf4j.Marker;
16  
17  import ch.qos.logback.classic.spi.ClassPackagingData;
18  
19  /**
20   * 
21   * @author Ceki Gulcu
22   */
23  public class Util {
24  
25    static Map<String, ClassPackagingData> cache = new HashMap<String, ClassPackagingData>();
26  
27    static public boolean match(Marker marker, Marker[] markerArray) {
28      if (markerArray == null) {
29        throw new IllegalArgumentException("markerArray should not be null");
30      }
31  
32      // System.out.println("event marker="+marker);
33  
34      final int size = markerArray.length;
35      for (int i = 0; i < size; i++) {
36        // System.out.println("other:"+markerArray[i]);
37  
38        if (marker.contains(markerArray[i])) {
39          return true;
40        }
41      }
42      return false;
43    }
44  
45   
46  }