项目作者: matis-schotte

项目描述 :
TracingActivity provides Apples Activity Tracing as part of Unified Logging for pure Swift applications.
高级语言: Swift
项目地址: git://github.com/matis-schotte/TracingActivity.git
创建时间: 2020-05-30T09:34:38Z
项目社区:https://github.com/matis-schotte/TracingActivity

开源协议:Apache License 2.0

下载


TracingActivity

build
tests
language
license

platform
Twitter

Ethereum
Litecoin

TracingActivity provides Apples Activity Tracing as part of Unified Logging for pure Swift applications.
Creation of a tracing activity can fail, but all blocks will always be executed.
The return values will inform if the code was executed inside the activity (success = true) or outside (in case the activity could not be created).
Nesting of activities is encouraged for sub-tasks.

Requirements

  • Swift >= 4
  • iOS >= 10
  • macOS >= 10.12
  • tvOS >= 10
  • watchOS >= 3.0

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Add the Package URL https://github.com/matis-schotte/TracingActivity.git in Xcodes project viewer.
Adding it to another Package as a dependency is as easy as adding it to the dependencies value of your Package.swift.

  1. dependencies: [
  2. .package(url: "https://github.com/matis-schotte/TracingActivity.git", from: "0.1.0")
  3. ]

Usage

Block-based activity tracing once:

  1. _ = TracingActivity.initiate("Activity") {
  2. // ... os_log stuff
  3. }

Activity tracing for multiple blocks:

  1. let activity: TracingActivity? = TracingActivity("Activity")
  2. _ = TracingActivity.apply(activity) {
  3. // ... os_log stuff
  4. }

Scope-based activity tracing:

  1. let activity: TracingActivity? = TracingActivity("Activity2")
  2. var scope = activity?.enter()
  3. // ... os_log stuff
  4. defer {
  5. scope?.leave()
  6. }

ToDo

  • Add SwiftLint (by adding xcodeproj: swift package generate-xcodeproj, helps support Xcode Server, too)
  • Add Travis CI (without xcodeproj see reddit, @aclaytonscott/creating-and-distributing-swift-packages-132444f5dd1">medium)
  • Add codecov
  • Add codebeat
  • Add codeclimate
  • Add codetriage
  • Add jazzy docs
  • Add CHANGELOG.md
  • Clean api docs
  • Add Carthage support
  • Add Cocoapods support

License

TracingActivity is available under the Apache-2.0 license. See the LICENSE file for more info.

Author

Matis Schotte, dm26f1cab8aa26@ungeord.net

https://github.com/matis-schotte/TracingActivity