Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing tracking to dead server #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions Simcoe/RemoteOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal struct RemoteOutput: Output {
/// The token.
let token: String

fileprivate let baseUrl = URL(string: "https://panalytics.herokuapp.com/")!
fileprivate let baseUrl = URL(string: "")!

fileprivate var url: URL {
return URL(string: token, relativeTo: baseUrl)!
Expand All @@ -26,23 +26,14 @@ internal struct RemoteOutput: Output {
init(token: String) {
self.token = token

Swift.print ("Simcoe now logging remotely to URL: \(url.absoluteString)")
Swift.print ("DISABLED : Simcoe now logging remotely to URL: \(url.absoluteString)")
}

/// Prints a message.
///
/// - Parameter message: The message.
func print(_ message: String) {
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let data = try! JSONSerialization.data(withJSONObject: ["analytics": message], options: JSONSerialization.WritingOptions(rawValue: 0))
request.httpBody = data

URLSession(configuration: URLSessionConfiguration.default)
.dataTask(with: request)
.resume()
//removing
}

}
2 changes: 1 addition & 1 deletion Simcoe/Tracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class Tracker {
/// standard output console.
///
/// - Parameter outputSources: The source to use for general output.
init(outputSources: [Output] = [ConsoleOutput(), RemoteOutput(token: Simcoe.session)]) {
init(outputSources: [Output] = [ConsoleOutput()]) {
self.outputSources = outputSources
}

Expand Down