Skip to content

yukselfa2/tca-swift-log

 
 

Repository files navigation

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%