 
 import Foundation
 
+public enum JSONKeys : String {
+  case EventName = "event_name"
+  case EventType = "event_type"
+  case Level = "level"
+  case Subject = "subject"
+  case Target = "target"
+  case Timestamp = "timestamp"
+}
+
 public protocol EventReporterSubject : CustomStringConvertible {
   var jsonDescription: JSON { get }
   var subSubjects: [EventReporterSubject] { get }


  var jsonDescription: JSON { get {
    return JSON.jDictionary([
      "event_name" : JSON.jString(EventName.Log.rawValue),
      "event_type" : JSON.jString(EventType.Discrete.rawValue),
      "level" : JSON.jString(self.levelString),
      "subject" : JSON.jString(self.logString),
      "timestamp" : JSON.jNumber(NSNumber(value: round(Date().timeIntervalSince1970) as Double)),
    ])
  }}



  var jsonDescription: JSON { get {
    return JSON.jDictionary([
      JSONKeys.EventName.rawValue : JSON.jString(self.eventName.rawValue),
      JSONKeys.EventType.rawValue : JSON.jString(self.eventType.rawValue),
      JSONKeys.Subject.rawValue : self.subject.jsonDescription,
      JSONKeys.Timestamp.rawValue : JSON.jNumber(NSNumber(value: round(Date().timeIntervalSince1970) as Double)),
    ])
  }}

