forked from darrarski/tca-swift-log
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Point-Free, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Dariusz Rybicki Darrarski | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# ComposableArchitecture + SwiftLog | ||
|
||
![Swift v5.8](https://img.shields.io/badge/swift-v5.8-orange.svg) | ||
![platforms iOS, macOS, tvOS, watchOS](https://img.shields.io/badge/platforms-iOS,_macOS,_tvOS,_watchOS-blue.svg) | ||
|
||
Log actions and state changes in [ComposableArchitecture](https://github.com/pointfreeco/swift-composable-architecture) applications using [SwiftLog](https://github.com/apple/swift-log) library. | ||
|
||
## π Usage | ||
|
||
Use [Swift Package Manager](https://swift.org/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: | ||
|
||
```swift | ||
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](Examples/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](https://kean-docs.github.io/pulseui/documentation/pulseui/) logs console. | ||
|
||
The example app uses [Pulse](https://github.com/kean/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](Examples/Screenshot001.png) | ||
![Standups iOS app + PulseUI console](Examples/Screenshot002.png) | ||
|
||
## π 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? | ||
|
||
<a href="https://www.buymeacoffee.com/darrarski" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60" width="217" style="height: 60px !important;width: 217px !important;" ></a> | ||
|
||
## π License | ||
|
||
Copyright Β© 2023 Dariusz Rybicki Darrarski | ||
|
||
License: [MIT](LICENSE) |