Browse Source

Use Logger instead of print.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
24bb901400
  1. 5
      Clocker/Overall App/ConfigExport.swift
  2. 2
      Clocker/Overall App/DataStore.swift
  3. 3
      Clocker/Panel/Rate Controller/UpcomingEventView.swift

5
Clocker/Overall App/ConfigExport.swift

@ -1,6 +1,7 @@
// Copyright © 2015 Abhishek Banthia // Copyright © 2015 Abhishek Banthia
import CoreModelKit import CoreModelKit
import CoreLoggerKit
import Foundation import Foundation
struct ConfigExport { struct ConfigExport {
@ -34,7 +35,7 @@ struct ConfigExport {
var clockerPrefs: [String: Any] = [:] var clockerPrefs: [String: Any] = [:]
for (key, value) in dictionaryRep { for (key, value) in dictionaryRep {
if selectedKeys.contains(key) { if selectedKeys.contains(key) {
print("Key is \(key) and value is \(value)") Logger.info("Config Export: Key is \(key) and value is \(value)")
clockerPrefs[key] = value clockerPrefs[key] = value
} }
} }
@ -73,7 +74,7 @@ struct ConfigExport {
let json = try JSONSerialization.data(withJSONObject: clockerPrefs, options: .prettyPrinted) let json = try JSONSerialization.data(withJSONObject: clockerPrefs, options: .prettyPrinted)
print(json) print(json)
} catch { } catch {
print("Failure Observed \(error.localizedDescription)") Logger.info("Failure Observed \(error.localizedDescription)")
} }
} }
} }

2
Clocker/Overall App/DataStore.swift

@ -66,7 +66,7 @@ class DataStore: NSObject {
@objc func ubiquitousKeyValueStoreChanged(_ notification: Notification) { @objc func ubiquitousKeyValueStoreChanged(_ notification: Notification) {
let userInfo = notification.userInfo ?? [:] let userInfo = notification.userInfo ?? [:]
let ubiquitousStore = notification.object as? NSUbiquitousKeyValueStore let ubiquitousStore = notification.object as? NSUbiquitousKeyValueStore
print("--- User Info is \(userInfo)") Logger.info("Ubiquitous Store Changed: User Info is \(userInfo)")
let currentTimezones = userDefaults.object(forKey: CLDefaultPreferenceKey) as? [Data] let currentTimezones = userDefaults.object(forKey: CLDefaultPreferenceKey) as? [Data]
let cloudTimezones = ubiquitousStore?.object(forKey: CLDefaultPreferenceKey) as? [Data] let cloudTimezones = ubiquitousStore?.object(forKey: CLDefaultPreferenceKey) as? [Data]
let cloudLastUpdateDate = (ubiquitousStore?.object(forKey: CLUbiquitousStoreLastUpdateKey) as? Date) ?? Date() let cloudLastUpdateDate = (ubiquitousStore?.object(forKey: CLUbiquitousStoreLastUpdateKey) as? Date) ?? Date()

3
Clocker/Panel/Rate Controller/UpcomingEventView.swift

@ -1,6 +1,7 @@
// Copyright © 2015 Abhishek Banthia // Copyright © 2015 Abhishek Banthia
import Cocoa import Cocoa
import CoreLoggerKit
class ModernSliderContainerView: NSView { class ModernSliderContainerView: NSView {
private var trackingArea: NSTrackingArea? private var trackingArea: NSTrackingArea?
@ -67,7 +68,7 @@ class DraggableClipView: NSClipView {
clickPoint = nil clickPoint = nil
gestureInProgress = false gestureInProgress = false
default: default:
print("Default case is happening \(event.type)") Logger.info("Default mouse event occurred for \(event.type)")
} }
} }
} }

Loading…
Cancel
Save