| 1 | | | |
| 2 | | | |
| 3 | | | |
| 4 | | | |
| 5 | | | |
| 6 | | | |
| 7 | | | |
| 8 | | | |
| 9 | | | |
| 10 | | | |
| 11 | | | |
| 12 | | | |
| 13 | | | |
| 14 | | | |
| 15 | | | |
| 16 | | | |
| 17 | | | |
| 18 | | | |
| 19 | | | |
| 20 | | | |
| 21 | | | |
| 22 | | | |
| 23 | | | |
| 24 | | | |
| 25 | | | |
| 26 | | | |
| 27 | | | |
| 28 | | | |
| 29 | | | |
| 30 | | | |
| 31 | | | |
| 32 | | | |
| 33 | | | package org.jcoderz.commons.logging; |
| 34 | | | |
| 35 | | | import java.util.logging.Filter; |
| 36 | | | import java.util.logging.LogRecord; |
| 37 | | | |
| 38 | | | import org.jcoderz.commons.Loggable; |
| 39 | | | |
| 40 | | | |
| 41 | | | |
| 42 | | | |
| 43 | | | @author |
| 44 | | | |
| 45 | 0 | | public abstract class LogFilterBase |
| 46 | | | implements Filter |
| 47 | | | { |
| 48 | | | protected Loggable getLoggable (LogRecord record) |
| 49 | | | { |
| 50 | | | final Loggable result; |
| 51 | 0 | | if ((record.getParameters() != null) |
| 52 | | | && record.getParameters().length > 0) |
| 53 | | | { |
| 54 | 0 | | final Object param = record.getParameters()[0]; |
| 55 | | | |
| 56 | 0 | | if (param instanceof Loggable) |
| 57 | | | { |
| 58 | 0 | | result = (Loggable) param; |
| 59 | | | } |
| 60 | | | else |
| 61 | | | { |
| 62 | 0 | | result = null; |
| 63 | | | } |
| 64 | 0 | | } |
| 65 | | | else |
| 66 | | | { |
| 67 | 0 | | result = null; |
| 68 | | | } |
| 69 | 0 | | return result; |
| 70 | | | } |
| 71 | | | |
| 72 | | | } |