   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 {
+    if mode.intersect(.FileName) != [] {
+        
       let filename = file.lastPathComponent.stringByDeletingPathExtension
       result = "\(filename)."
     }
-    if mode & .FuncName != nil {
+    if mode.intersect(.FuncName) != [] {
       result += "\(function)"
     }
-    if mode & .Line != nil {
+    if mode.intersect(.Line) != [] {
       result += "[\(line)]"
     }
     


typealias SLog = SpeedLog

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

  public static func println<T>(object: T, _ file: String = __FILE__, _ function: String = __FUNCTION__, _ line: Int = __LINE__) {
    #if ENABLE_LOG
      let s = printStringForMode(object, file: file, function: function, line: line)
      Swift.print(s)
    #endif
  }
  
  public static func print<T>(object: T, _ file: String = __FILE__, _ function: String = __FUNCTION__, _ line: Int = __LINE__) {
    #if ENABLE_LOG
      let s = printStringForMode(object, file: file, function: function, line: line)
      Swift.print(s, terminator: "")
    #endif
  }
}
