1 4 package org.oddjob.logging; 5 6 import java.io.Serializable ; 7 8 17 public class LogEvent implements Serializable { 18 19 private final long number; 20 private final LogLevel level; 21 private final String logger; 22 private final String message; 23 24 32 public LogEvent(String logger, 33 long number, LogLevel level, 34 String message) { 35 if (logger == null) { 36 throw new NullPointerException ("Logger can not be null!"); 37 } 38 if (number < 0) { 39 throw new IllegalArgumentException ("Sequence Number must be positive!"); 40 } 41 if (level == null) { 42 throw new NullPointerException ("Log Level can not be null!"); 43 } 44 if (message == null) { 45 throw new NullPointerException ("Message can not be null!"); 46 } 47 48 this.number = number; 49 this.level = level; 50 this.logger = logger; 51 this.message = message; 52 } 53 56 public LogLevel getLevel() { 57 return level; 58 } 59 62 public String getLogger() { 63 return logger; 64 } 65 68 public String getMessage() { 69 return message; 70 } 71 74 public long getNumber() { 75 return number; 76 } 77 } 78 | Popular Tags |