 import Foundation
 import Shared
 import Storage
+import XCGLogger
+
+private let log = Logger.browserLogger
 
 public class TabsPayload: CleartextPayloadJSON {
     public class Tab {

        func toRemoteTabForClient(guid: GUID) -> RemoteTab? {
            let urls = optFilter(urlHistory.map({ $0.asURL }))
            if urls.isEmpty {
                return nil
            }



    var remoteTabs: [RemoteTab] {
        if let clientGUID = self["id"].asString {
            let payloadTabs = self["tabs"].asArray!
            let remoteTabs = optFilter(payloadTabs.map({ Tab.remoteTabFromJSON($0, clientGUID: clientGUID) }))
            if payloadTabs.count != remoteTabs.count {
                log.debug("Bug 1201875 - Missing remote tabs from sync")
            }
            return remoteTabs
        }
        log.debug("no client ID for remote tabs")
        return []
    }

