     return result
   }
 }
+
+extension String {
+    var ns: NSString {
+        return self as NSString
+    }
+    var lastPathComponent: String {
+        return ns.lastPathComponent
+    }
+    var stringByDeletingPathExtension: String {
+        return ns.stringByDeletingPathExtension
+    }
+}

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


typealias SLog = SpeedLog

public struct LogMode : OptionSetType {
  
  private var value: UInt = 0
  
