1 16 package org.apache.log4j.chainsaw; 17 18 import org.apache.log4j.Priority; 19 import org.apache.log4j.spi.LoggingEvent; 20 21 28 class EventDetails { 29 30 31 private final long mTimeStamp; 32 33 private final Priority mPriority; 34 35 private final String mCategoryName; 36 37 private final String mNDC; 38 39 private final String mThreadName; 40 41 private final String mMessage; 42 43 private final String [] mThrowableStrRep; 44 45 private final String mLocationDetails; 46 47 58 EventDetails(long aTimeStamp, 59 Priority aPriority, 60 String aCategoryName, 61 String aNDC, 62 String aThreadName, 63 String aMessage, 64 String [] aThrowableStrRep, 65 String aLocationDetails) 66 { 67 mTimeStamp = aTimeStamp; 68 mPriority = aPriority; 69 mCategoryName = aCategoryName; 70 mNDC = aNDC; 71 mThreadName = aThreadName; 72 mMessage = aMessage; 73 mThrowableStrRep = aThrowableStrRep; 74 mLocationDetails = aLocationDetails; 75 } 76 77 82 EventDetails(LoggingEvent aEvent) { 83 84 this(aEvent.timeStamp, 85 aEvent.getLevel(), 86 aEvent.getLoggerName(), 87 aEvent.getNDC(), 88 aEvent.getThreadName(), 89 aEvent.getRenderedMessage(), 90 aEvent.getThrowableStrRep(), 91 (aEvent.getLocationInformation() == null) 92 ? null : aEvent.getLocationInformation().fullInfo); 93 } 94 95 96 long getTimeStamp() { 97 return mTimeStamp; 98 } 99 100 101 Priority getPriority() { 102 return mPriority; 103 } 104 105 106 String getCategoryName() { 107 return mCategoryName; 108 } 109 110 111 String getNDC() { 112 return mNDC; 113 } 114 115 116 String getThreadName() { 117 return mThreadName; 118 } 119 120 121 String getMessage() { 122 return mMessage; 123 } 124 125 126 String getLocationDetails(){ 127 return mLocationDetails; 128 } 129 130 131 String [] getThrowableStrRep() { 132 return mThrowableStrRep; 133 } 134 } 135 | Popular Tags |