         }
     }
 
-    fileprivate func cleanedFilename(_ filename:String) -> String {
-        if let cleanedfile:String = cleanedFilenamesCache.object(forKey:filename as AnyObject) as? String {
+    fileprivate func cleanedFilename(_ filename: String) -> String {
+        if let cleanedfile:String = cleanedFilenamesCache.object(forKey: filename as AnyObject) as? String {
             return cleanedfile
         } else {
             var retval = ""
-            let items = filename.characters.split{$0 == "/"}.map(String.init)
-            
+            let items = filename.split{$0 == "/"}.map(String.init)
             
             if items.count > 0 {
                 retval = items.last!
             }
-            cleanedFilenamesCache.setObject(retval as AnyObject, forKey:filename as AnyObject)
+            cleanedFilenamesCache.setObject(retval as AnyObject, forKey: filename as AnyObject)
             return retval
         }
     }
 
-    fileprivate func isSourceFileEnabled(_ cleanedFile:String) -> Bool {
+    fileprivate func isSourceFileEnabled(_ cleanedFile: String) -> Bool {
         switch SlimConfig.sourceFilesThatShouldLog {
-            case .all:
+        case .all:
+            return true
+        case .none:
+            return false
+        case .enabledSourceFiles(let enabledFiles):
+            if enabledFiles.contains(cleanedFile) {
                 return true
-            case .none:
+            } else {
                 return false
-            case .enabledSourceFiles(let enabledFiles):
-                if enabledFiles.contains(cleanedFile) {
-                    return true
-                } else {
-                    return false
-                }
+            }
         }
     }
 }

open class Slim {

    var logDestinations: [LogDestination] = []
    var cleanedFilenamesCache:NSCache<AnyObject,AnyObject> = NSCache<AnyObject,AnyObject>()

    init() {
        if SlimConfig.enableConsoleLogging {
            logDestinations.append(ConsoleDestination())
        }
    }


            return "FATAL"
        }
    }
}

public protocol LogDestination {
    func log<T>( _ message: @autoclosure () -> T, level: LogLevel, filename: String, line: Int)
}

private let slim = Slim()
