 
 typealias SLog = SpeedLog
 
-public struct LogMode : RawOptionSetType {
+public struct LogMode : OptionSetType {
   
   private var value: UInt = 0
   

  public init(rawValue value: UInt)  { self.value = value }
  public init(nilLiteral: ())        { self.value = 0 }
  
  public static var allZeros: LogMode { return self(0) }
  public var rawValue: UInt { return self.value }
  
  //MARK:- Options
  public static var None: LogMode        { return self(0) }
  public static var FileName: LogMode    { return self(1 << 0) }
  public static var FuncName: LogMode    { return self(1 << 1) }
  public static var Line: LogMode        { return self(1 << 2) }

//Helper
  public static var AllOptions: LogMode  { return FileName | FuncName | Line }
}

public struct SpeedLog {

  static func printStringForMode<T>(object: T, file: String, function: String, line: Int) -> String {
    var result: String = ""
    //print("\(filename).\(function)[\(line)]: \(object)\n")
    if mode.intersect(.FileName) != [] {
        
      let filename = file.lastPathComponent.stringByDeletingPathExtension
      result = "\(filename)."
    }
    if mode.intersect(.FuncName) != [] {
      result += "\(function)"
    }
    if mode.intersect(.Line) != [] {
      result += "[\(line)]"
    }
    
