Log actions and state changes in ComposableArchitecture applications using SwiftLog library.
Use Swift Package Manager to add the TCASwiftLog
library as a dependency to your project.
Use _ReducerPrinter.swiftLog
on your reducer to log actions and state mutations:
import TCASwiftLog
let store = Store(initialState: AppFeature.State()) {
AppFeature()._printChanges(.swiftLog(label: "tca"))
}
This repository contains an example iOS application from ComposableArchitecture repository - Standups.
- Open
TCASwiftLog.xcworkspace
in Xcode. - Run the example app using
Standups
build scheme. - "Standups" tab contains UI of the example app.
- "Logs Console" tab contains PulseUI logs console.
The example app uses Pulse as a logging system's log handler. It also integrates UI for logs console. Remote logging can be enabled in the console settings.
TCASwiftLog (Xcode Workspace)
├─ tca-swift-log (Swift Package)
| └─ TCASwiftLog (Library)
└─ Standups (Xcode Project)
└─ Standups (Example iOS Application)
- Use Xcode (version ≥ 14.3.1).
- Clone the repository or create a fork & clone it.
- Open
TCASwiftLog.xcworkspace
in Xcode. - Use the
TCASwiftLog
scheme for building the library and running unit tests. - If you want to contribute, create a pull request containing your changes or bug fixes. Make sure to include tests for new/updated code.
Copyright © 2023 Dariusz Rybicki Darrarski
License: MIT