-
Notifications
You must be signed in to change notification settings - Fork 12
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
DX improvements and more info in logs #93
base: master
Are you sure you want to change the base?
Changes from all commits
f2e71f7
a257913
2346ec1
6cc170e
86c56f1
06c8b36
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Apply to all files | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Ruby specific rules | ||
[{*.rb,Fastfile,Gemfile}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{swift,h,m}] | ||
indent_style = space | ||
indent_size = 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ xcuserdata/* | |
|
||
# Ruby tooling | ||
vendor/bundle | ||
|
||
|
||
# SwiftLint Remote Config Cache | ||
.swiftlint/RemoteConfigCache |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
swiftlint_version: 0.57.0 | ||
|
||
parent_config: https://raw.githubusercontent.com/Automattic/swiftlint-config/b497131f8d0fddbf3b23278cfc4ef8d86c9bcb20/.swiftlint.yml | ||
remote_timeout: 10.0 | ||
|
||
excluded: | ||
- .build | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# TODO: Use newer Sim. Sticking with it at the moment because we know it works in the existing GitHub action setup. | ||
SIMULATOR_NAME ?= iPhone 14 | ||
SIMULATOR_OS ?= latest | ||
XCODE_PATH ?= /Applications/Xcode.app | ||
|
||
# Convenience to open the lib and demo project with Xcode, given it's not in the root. | ||
open: | ||
open -a $(XCODE_PATH) ./Demo/ParselyDemo.xcodeproj | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an advantage to using this method over |
||
|
||
# TODO: Move off xcpretty to xcbeautify. Sticking with it at the moment because we know it works in the existing GitHub action setup. | ||
test: | ||
set -o pipefail \ | ||
&& xcodebuild test \ | ||
-project Demo/ParselyDemo.xcodeproj \ | ||
-scheme ParselyDemo \ | ||
-sdk iphonesimulator \ | ||
-destination 'platform=iOS Simulator,name=$(SIMULATOR_NAME),OS=$(SIMULATOR_OS)' \ | ||
| xcpretty | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I verified that this new syntax with the See #95 |
||
|
||
# TODO: Add automation to set up SwiftLint | ||
format: | ||
swiftlint --fix --format |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,8 +22,7 @@ class Track { | |||||
parselyTracker.startFlushTimer(); | ||||||
|
||||||
pixel.beacon(event: event) | ||||||
os_log("Sending an event from Track", log: OSLog.tracker, type:.debug) | ||||||
dump(event.toDict()) | ||||||
os_log_sending_event(event) | ||||||
} | ||||||
|
||||||
func pageview(url: String, urlref: String = "", metadata: ParselyMetadata?, extra_data: Dictionary<String, Any>?, idsite: String) { | ||||||
|
@@ -82,3 +81,10 @@ class Track { | |||||
videoManager.sendHeartbeats() | ||||||
} | ||||||
} | ||||||
|
||||||
/// Utitlity to log sending event with a dump of the event. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
private func os_log_sending_event(_ event: Event, log: OSLog = .tracker, type: OSLogType = .debug) { | ||||||
var eventDump = "" | ||||||
dump(event.toDict(), to: &eventDump) | ||||||
os_log("Sending an event from Track:\n%@", log: log, type: type, eventDump) | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this type is needed.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, 06c8b36 Thanks! |
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 ought to go in the the remote config, too.