// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   ErrorLogEngine.java

package lt.monarch.debug;

import java.util.Date;

public interface ErrorLogEngine
{
	public static class LogPacket
	{

		private Date timestamp;
		private Throwable exception;
		private String text;

		public Date timestamp()
		{
			return timestamp;
		}

		public Throwable exception()
		{
			return exception;
		}

		public String text()
		{
			if(exception == null)
				return text;
			if(exception.getMessage() == null)
				return debugText();
			else
				return text != null ? text + " (" + exception.getMessage() + ")" : exception.getMessage();
		}

		public String debugText()
		{
			if(exception == null)
				return text;
			else
				return text != null ? text + " (" + exception.toString() + ")" : exception.toString();
		}

		public LogPacket(String s, Throwable throwable)
		{
			timestamp = new Date();
			exception = throwable;
			text = s;
		}

		public LogPacket(String s)
		{
			this(s, null);
		}

		public LogPacket(Throwable throwable)
		{
			this(null, throwable);
		}
	}


	public abstract void log(LogPacket logpacket);

	public abstract void close();
}
