|
| 1 | +packagemodels; |
| 2 | + |
| 3 | +importenums.ReportLevel; |
| 4 | +importinterfaces.Appender; |
| 5 | +importinterfaces.Layout; |
| 6 | + |
| 7 | +publicabstractclassAppenderImplimplementsAppender { |
| 8 | + |
| 9 | +publicstaticfinalReportLevelREPORT_LEVEL_DEFAULT =ReportLevel.INFO; |
| 10 | + |
| 11 | +privateLayoutlayout; |
| 12 | +privateReportLevelreportLevel; |
| 13 | +privateintmessagesCOunt; |
| 14 | + |
| 15 | + |
| 16 | +publicAppenderImpl(Layoutlayout) { |
| 17 | +this.layout =layout; |
| 18 | +this.reportLevel =AppenderImpl.REPORT_LEVEL_DEFAULT; |
| 19 | +this.messagesCOunt =0; |
| 20 | + } |
| 21 | + |
| 22 | +publicAppenderImpl(Layoutlayout,ReportLevelreportLevel) { |
| 23 | +this(layout); |
| 24 | +this.reportLevel =reportLevel; |
| 25 | + } |
| 26 | + |
| 27 | +publicvoidsetReportLevel(ReportLevelreportLevel) { |
| 28 | +this.reportLevel =reportLevel; |
| 29 | + } |
| 30 | + |
| 31 | +publicLayoutgetLayout() { |
| 32 | +returnlayout; |
| 33 | + } |
| 34 | + |
| 35 | + |
| 36 | +@Override |
| 37 | +publicabstractvoidappend(Stringtime,Stringmessage,ReportLevelreportLevel); |
| 38 | + |
| 39 | +protectedbooleancanAppend(ReportLevelreportLevel) { |
| 40 | +returnthis.reportLevel.ordinal() <=reportLevel.ordinal(); |
| 41 | + } |
| 42 | +} |