//
//  AsyncType+Debug.swift
//  BrightFutures
//
//  Created by Oleksii on 23/09/2016.
//  Copyright © 2016 Thomas Visser. All rights reserved.
//

import Result

public protocol LoggerType {
    func log(message: String)
}

struct Logger: LoggerType {
    func log(message: String) {
        print(message)
    }
}

public extension AsyncType where Value: ResultProtocol {
    public func debug(logger: LoggerType = Logger(), context c: @escaping ExecutionContext = DefaultThreadingModel(), messageBlock: @escaping (Self.Value) -> String) -> Self {
        return andThen(context: c, callback: { result in
            logger.log(message: messageBlock(result))
        })
    }
}

//
//  AsyncType+Debug.swift
//  BrightFutures
//
//  Created by Oleksii on 23/09/2016.
//  Copyright © 2016 Thomas Visser. All rights reserved.
//

import Result

public protocol LoggerType {
    func log(message: String)
}

struct Logger: LoggerType {
    func log(message: String) {
        print(message)
    }
}

--- 
+++ 
@@ -17,3 +17,11 @@
         print(message)
     }
 }
+
+public extension AsyncType where Value: ResultProtocol {
+    public func debug(logger: LoggerType = Logger(), context c: @escaping ExecutionContext = DefaultThreadingModel(), messageBlock: @escaping (Self.Value) -> String) -> Self {
+        return andThen(context: c, callback: { result in
+            logger.log(message: messageBlock(result))
+        })
+    }
+}
Add public debug func on async type

Debug function takes provided message with block and calls logger's log function
