A library to send all messages from either frameworks or the parent application to the parent application for consumption. This means the parent application will solely be responsible for sending to: The console, UI toasting, monitoring network activity, sending to Flurry / Google Analytics / Firebase / Crashlytics, some logging solution, or > /dev/null.
Workflows
Logging
Error, Warning, Debug, Info
A console friendly message is passed to the parent application
Errors are ALSO passed to a seperate method and are expected to be logged to an error logging solution such as Crashlytics non-fatal logging
Analytics
Set screen name for workflow
Log an event
User Messaging
Toast messages
Performance
Measuring the time is takes between starting, incrementating, and stopping a trace.
Option 1: Run with the current XCode project as is
Option 2: Rebuild it using generate-xcodeproj
Setup: Package Manager Example: rm -rf *.xcodeproj || rm -rf .build || swift package resolve && swift package generate-xcodeproj && open *.xcodeproj
Building: In the Target TimberSwift, select the tab Signing & Capabilities and check the box Automatically manage signing
Code Coverage: In the scheme menu, select Edit Scheme..., select the Test item on the left, select the tab Options, and check the box Gather coverage for "all targets"
Mocking: In the target TimberSwiftTests select the tab Build Phases and add a Run Script Phase with the body $PROJECT_DIR/Scripts/parrot.sh and move the item to the top of the Buld Phases just below Dependencies.
Linting: In the target TimberSwift select the tab Build Phases and add a Run Script Phase with the body $PROJECT_DIR/Scripts/swiftlint.sh.
TimberSwift
What is TimberSwift?
A library to send all messages from either frameworks or the parent application to the parent application for consumption. This means the parent application will solely be responsible for sending to: The console, UI toasting, monitoring network activity, sending to Flurry / Google Analytics / Firebase / Crashlytics, some logging solution, or
> /dev/null
.Workflows
Installation
Carthage
github "MonsantoCo/TimberSwift" ~> 1.0.0
Package Manager
.package(url: "git@github.com:MonsantoCo/TimberSwift.git", from: "1.0.0")
Instructions
Create a Timber object and begin using any or all of the workflows
The parent application should assign itself as the TimberApplicationDelegate as soon as possble to receive any and all messages from Timber objects.
Extending TimberSwift in XCode
Option 1: Run with the current XCode project as is
Option 2: Rebuild it using
generate-xcodeproj
rm -rf *.xcodeproj || rm -rf .build || swift package resolve && swift package generate-xcodeproj && open *.xcodeproj
TimberSwift
, select the tabSigning & Capabilities
and check the boxAutomatically manage signing
Edit Scheme...
, select theTest
item on the left, select the tabOptions
, and check the boxGather coverage for "all targets"
TimberSwiftTests
select the tabBuild Phases
and add aRun Script Phase
with the body$PROJECT_DIR/Scripts/parrot.sh
and move the item to the top of the Buld Phases just belowDependencies
.TimberSwift
select the tabBuild Phases
and add aRun Script Phase
with the body$PROJECT_DIR/Scripts/swiftlint.sh
.