-
Notifications
You must be signed in to change notification settings - Fork 109
Added Logger and SegmentLogger plugin. #46
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
Changes from 10 commits
a581421
5be2b9a
23e4f59
d7da288
783f8f7
177cc4e
f8d255c
15ceabb
000b7fe
3ca79ac
9f2bfad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,17 +53,17 @@ class ConsoleLogger: Plugin { | |
| // we want to log every event, so lets override `execute`. | ||
| func execute<T: RawEvent>(event: T?) -> T? { | ||
| if let json = event?.prettyPrint() { | ||
| print("event received on instance: \(name)") | ||
| print("\(json)\n") | ||
| analytics?.log(message: "event received on instance: \(name)") | ||
| analytics?.log(message: "\(json)\n") | ||
| } | ||
| return event | ||
| } | ||
|
|
||
| // we also want to know when settings are retrieved or changed. | ||
| func update(settings: Settings) { | ||
| let json = settings.prettyPrint() | ||
| print("settings updated on instance: \(name)") | ||
| print("\(json)\n") | ||
| analytics?.log(message: "settings updated on instance: \(name)") | ||
|
||
| analytics?.log(message: "\(json)\n") | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,7 +122,7 @@ extension UIViewController { | |
| guard let top = Self.seg__visibleViewController(activeController()) else { return } | ||
|
|
||
| var name = String(describing: top.self.classForCoder).replacingOccurrences(of: "ViewController", with: "") | ||
| print(name) | ||
| analytics?.log(message: name) | ||
|
||
| // name could've been just "ViewController"... | ||
| if name.count == 0 { | ||
| name = top.title ?? "Unknown" | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // | ||
| // ConsoleTarget.swift | ||
| // ConsoleTarget | ||
| // | ||
| // Created by Cody Garvin on 8/19/21. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| class ConsoleTarget: LogTarget { | ||
| func parseLog(_ log: LogMessage) { | ||
| var metadata = "" | ||
| if let function = log.function, let line = log.line { | ||
| metadata = " - \(function):\(line)" | ||
| } | ||
| print("[Segment \(log.kind.toString())\(metadata)]\n\(log.message)\n") | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be more descriptive rather than just the deep link result.