using System;
using System.Collections.Generic;
using System.Text;

namespace Salamax
{
  public static class Logger
  {
    public enum Type
    {
      Undefined = 0,
      Information = 1,
      Warning = 2,
      Error = 3
    };

    public delegate void LogEventHandler(object sender, LogEventArgs e);
    public static event LogEventHandler ItemAdded;

    public static void WriteLine(string message, Type type)
    {
      message = DateTime.Now.ToString() + ": " + message;
      Console.WriteLine(message);

      if (ItemAdded != null)
        ItemAdded(null, new LogEventArgs(type, message));
    }
  }
}
