1 /**
2 * Logback: the reliable, generic, fast and flexible logging framework.
3 * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4 *
5 * This program and the accompanying materials are dual-licensed under
6 * either the terms of the Eclipse Public License v1.0 as published by
7 * the Eclipse Foundation
8 *
9 * or (per the licensee's choosing)
10 *
11 * under the terms of the GNU Lesser General Public License version 2.1
12 * as published by the Free Software Foundation.
13 */
14 package ch.qos.logback.core.sift;
15
16 import ch.qos.logback.core.Context;
17 import ch.qos.logback.core.model.processor.DefaultProcessor;
18 import ch.qos.logback.core.model.processor.ModelInterpretationContext;
19
20 public class SiftProcessor<E> extends DefaultProcessor {
21
22
23 public SiftProcessor(Context context, ModelInterpretationContext mic) {
24 super(mic.getContext(), mic);
25 }
26
27 ModelInterpretationContext getModelInterpretationContext() {
28 return mic;
29 }
30
31 // final static String ONE_AND_ONLY_ONE_URL = CoreConstants.CODES_URL + "#1andOnly1";
32
33
34 // void foo() {
35 // this.modelInterpretationContext = new ModelInterpretationContext(context);
36 // buildModelInterpretationContext();
37 // DefaultProcessor defaultProcessor = new DefaultProcessor(context, this.modelInterpretationContext);
38 // addModelHandlerAssociations(defaultProcessor);
39 //
40 // }
41
42
43 //abstract public Appender<E> getAppender();
44
45 // int errorEmmissionCount = 0;
46 //
47 // protected void oneAndOnlyOneCheck(Map<?, ?> appenderMap) {
48 // String errMsg = null;
49 // if (appenderMap.size() == 0) {
50 // errorEmmissionCount++;
51 // errMsg = "No nested appenders found within the <sift> element in SiftingAppender.";
52 // } else if (appenderMap.size() > 1) {
53 // errorEmmissionCount++;
54 // errMsg = "Only and only one appender can be nested the <sift> element in SiftingAppender. See also "
55 // + ONE_AND_ONLY_ONE_URL;
56 // }
57 //
58 // if (errMsg != null && errorEmmissionCount < CoreConstants.MAX_ERROR_COUNT) {
59 // addError(errMsg);
60 // }
61 // }
62
63 // @Override
64 // public String toString() {
65 // return this.getClass().getName() + "{" + key + "=" + value + '}';
66 // }
67
68 }