1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.util;
21
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24
25 import javax.faces.event.ActionListener;
26 import javax.faces.event.ActionEvent;
27 import javax.faces.event.AbortProcessingException;
28 import java.lang.invoke.MethodHandles;
29
30 public class DebugActionListener implements ActionListener {
31
32 private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
33
34 private final ActionListener actionListener;
35
36
37 public DebugActionListener(final ActionListener actionListener) {
38 this.actionListener = actionListener;
39 }
40
41 @Override
42 public void processAction(final ActionEvent actionEvent) throws AbortProcessingException {
43 if (LOG.isDebugEnabled()) {
44 LOG.debug("processAction " + actionEvent);
45 }
46 actionListener.processAction(actionEvent);
47 }
48 }