RuntimeTools / SwiftMetrics

Swift Application Metrics instruments the Swift runtime for performance monitoring, providing the monitoring data programatically via an API or visually with an Eclipse Client.
https://developer.ibm.com/swift/monitoring-diagnostics/application-metrics-for-swift/
Other
156 stars 50 forks source link

Multiple deprecation warnings compiling a Swift 4 Kitura application #162

Closed helenmasters closed 7 years ago

helenmasters commented 7 years ago

I was just testing out the Getting Started instructions for the latest version of Kitura (which supports Swift 4) at http://www.kitura.io/en/starter/gettingstarted.html and encountered the following deprecation warnings:

/Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetrics/SwiftMetrics.swift:112:39: warning: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator. applicationPath = workingPath.substring(to: i.lowerBound) ^ /Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetrics/SwiftMetrics.swift:231:44: warning: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator. defaultLibraryPath = programPath.substring(to: i!.lowerBound) ^ /Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetrics/SwiftMonitor.swift:190:21: warning: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator. env[value.substring(to: firstEquals)] = value.substring(from: value.index(after: firstEquals)) ^ /Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetrics/SwiftMonitor.swift:190:57: warning: 'substring(from:)' is deprecated: Please use String slicing subscript with a 'partial range from' operator. env[value.substring(to: firstEquals)] = value.substring(from: value.index(after: firstEquals))

/Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetricsDash/SwiftMetricsDash.swift:266:45: warning: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator. messageToSend = messageToSend.substring(to: messageToSend.index(before: messageToSend.endIndex)) ^ /Users/helenmasters/HelloKitura/.build/checkouts/SwiftMetrics.git-8417478658542232501/Sources/SwiftMetricsDash/SwiftMetricsDash.swift:266:45: warning: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator. messageToSend = messageToSend.substring(to: messageToSend.index(before: messageToSend.endIndex)) ^

ianpartridge commented 7 years ago

https://github.com/RuntimeTools/SwiftMetrics/pull/163 should fix this.