darrarski / tca-swift-log

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ComposableArchitecture + SwiftLog

Swift v5.8 platforms iOS, macOS, tvOS, watchOS

Log actions and state changes in ComposableArchitecture applications using SwiftLog library.

πŸ“– Usage

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"))
}

▢️ Example

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.

Standups iOS app + Pulse macOS app Standups iOS app + PulseUI console

πŸ› Project structure

TCASwiftLog (Xcode Workspace)
 β”œβ”€ tca-swift-log (Swift Package)
 |   └─ TCASwiftLog (Library)
 └─ Standups (Xcode Project)
     └─ Standups (Example iOS Application)

πŸ›  Develop

  • 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.

β˜•οΈ Do you like the project?

Buy Me A Coffee

πŸ“„ License

Copyright Β© 2023 Dariusz Rybicki Darrarski

License: MIT

About

License:MIT License


Languages

Language:Swift 100.0%