优化RTMP播放器重连和稳定性

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
caleb
2026-04-16 14:42:54 +08:00
parent f78ca66860
commit 72bfbb5cdf
81 changed files with 4869 additions and 5461 deletions

View File

@@ -4,26 +4,39 @@
CocoaLumberjack
===============
![Unit Tests](https://github.com/CocoaLumberjack/CocoaLumberjack/workflows/Unit%20Tests/badge.svg)
[![Pod Version](http://img.shields.io/cocoapods/v/CocoaLumberjack.svg?style=flat)](http://cocoadocs.org/docsets/CocoaLumberjack/)
[![Version](https://img.shields.io/github/release/CocoaLumberjack/CocoaLumberjack.svg?display_name=tag&style=flat)](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/latest)
[![License](https://img.shields.io/github/license/CocoaLumberjack/CocoaLumberjack.svg?style=flat)](https://opensource.org/licenses/BSD-3-Clause)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FCocoaLumberjack%2FCocoaLumberjack%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/CocoaLumberjack/CocoaLumberjack)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FCocoaLumberjack%2FCocoaLumberjack%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/CocoaLumberjack/CocoaLumberjack)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Pod Platform](http://img.shields.io/cocoapods/p/CocoaLumberjack.svg?style=flat)](http://cocoadocs.org/docsets/CocoaLumberjack/)
[![Pod License](http://img.shields.io/cocoapods/l/CocoaLumberjack.svg?style=flat)](http://opensource.org/licenses/BSD-3-Clause)
![Unit Tests](https://github.com/CocoaLumberjack/CocoaLumberjack/workflows/Unit%20Tests/badge.svg)
[![codecov](https://codecov.io/gh/CocoaLumberjack/CocoaLumberjack/branch/master/graph/badge.svg)](https://codecov.io/gh/CocoaLumberjack/CocoaLumberjack)
[![codebeat badge](https://codebeat.co/badges/840b714a-c8f3-4936-ada4-363473cd4e6b)](https://codebeat.co/projects/github-com-cocoalumberjack-cocoalumberjack-master)
**CocoaLumberjack** is a fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS.
**CocoaLumberjack** is a fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS, watchOS and visionOS.
## How to get started
First, install CocoaLumberjack via [CocoaPods](https://cocoapods.org), [Carthage](https://github.com/Carthage/Carthage), [Swift Package Manager](https://swift.org/package-manager/) or manually.
First, install CocoaLumberjack via [Swift Package Manager](https://swift.org/package-manager/), [CocoaPods](https://cocoapods.org), [Carthage](https://github.com/Carthage/Carthage) or manually.
Then use `DDOSLogger` for iOS 10 and later, or `DDTTYLogger` and `DDASLLogger` for earlier versions to begin logging messages.
### Swift Package Manager
As of CocoaLumberjack 3.6.0, you can use the Swift Package Manager as integration method.
If you want to use the Swift Package Manager as integration method, either use Xcode to add the package dependency or add the following dependency to your Package.swift:
```swift
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack", from: "3.9.0"),
```
Note that you may need to add both products, `CocoaLumberjack` and `CocoaLumberjackSwift` to your target since SPM sometimes fails to detect that `CocoaLumberjackSwift` depends on `CocoaLumberjack`.
### CocoaPods
```ruby
platform :ios, '9.0'
platform :ios, '11.0'
target 'SampleTarget' do
use_frameworks!
@@ -35,7 +48,7 @@ For more details about how to use Swift with Lumberjack, see [this conversation]
For Objective-C use the following:
```ruby
platform :ios, '9.0'
platform :ios, '11.0'
target 'SampleTarget' do
pod 'CocoaLumberjack'
@@ -53,18 +66,6 @@ Cartfile
github "CocoaLumberjack/CocoaLumberjack"
```
### Swift Package Manager
As of CocoaLumberjack 3.6.0, you can use the Swift Package Manager as integration method.
If you want to use the Swift Package Manager as integration method, either use Xcode to add the package dependency or add the following dependency to your Package.swift:
```swift
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack.git", from: "3.7.0"),
```
Note that you may need to add both products, `CocoaLumberjack` and `CocoaLumberjackSwift` to your target since SPM sometimes fails to detect that `CocoaLumerjackSwift` depends on `CocoaLumberjack`.
### Install manually
If you want to install CocoaLumberjack manually, read the [manual installation](Documentation/GettingStarted.md#manual-installation) guide for more information.
@@ -126,6 +127,18 @@ You can then use `DDLogHandler` as backend for swift-log, which will forward all
In your own log formatters, you can make use of the `swiftLogInfo` property on `DDLogMessage` to retrieve the details of a message that is logged via swift-log.
To use swift-log with CocoaLumberjack, take a look the following code snippet to see how to get started.
```swift
import CocoaLumberjack
import CocoaLumberjackSwiftLogBackend
import Logging
// In your application's entry point (e.g. AppDelegate):
DDLog.add(DDOSLogger.sharedInstance) // Configure loggers
LoggingSystem.bootstrapWithCocoaLumberjack() // Use CocoaLumberjack as swift-log backend
```
## More information
@@ -184,14 +197,15 @@ Configure your logging however you want. Change log levels per file (perfect for
## Requirements
The current version of Lumberjack requires:
- Xcode 12 or later
- Swift 5.3 or later
- iOS 9 or later
- macOS 10.10 or later
- watchOS 3 or later
- tvOS 9 or later
- Xcode 14.1 or later
- Swift 5.5 or later
- macOS 10.13 or later
- iOS 11 or later
- tvOS 11 or later
- watchOS 4 or later
### Backwards compatibility
- for iOS/tvOS up to 10, watchOS up to 3, macOS up to 10.12, Xcode up to 13 and Swift up to 5.4, use the 3.7.4 version
- for Xcode 11 and Swift up to 5.2, use the 3.6.2 version
- for Xcode 10 and Swift 4.2, use the 3.5.2 version
- for iOS 8, use the 3.6.1 version
@@ -219,7 +233,7 @@ Per [App privacy details on the App Store](https://developer.apple.com/app-store
### Data collection by the framework
**By default, CocoaLumberjack does NOT collect any data on its own.**
**By default, CocoaLumberjack does NOT collect any data on its own.**
[See our Data Collection Practices list.](https://cocoalumberjack.github.io/DataCollection/index.html)
@@ -257,7 +271,7 @@ _Example_: `DDLogInfo("User: \(myUser)")` will add the `myUser` info to the logs
## Author
- [Robbie Hanson](https://github.com/robbiehanson)
- Love the project? Wanna buy me a coffee? (or a beer :D) [![donation](http://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UZRA26JPJB3DA)
- Love the project? Wanna buy me a coffee? (or a beer :D) [![donation](https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UZRA26JPJB3DA)
## Collaborators
- [Ernesto Rivera](https://github.com/rivera-ernesto)
@@ -276,6 +290,8 @@ _Example_: `DDLogInfo("User: \(myUser)")` will add the `myUser` info to the logs
- CocoaLumberjack is available under the BSD 3 license. See the [LICENSE file](LICENSE).
## Extensions
- [Birch-Lumberjack](https://github.com/gruffins/birch-lumberjack) A remote logger for CocoaLumberjack
- [BugfenderSDK-CocoaLumberjack](https://github.com/bugfender/BugfenderSDK-CocoaLumberjack) A Bugfender logger for CocoaLumberjack
- [LogIO-CocoaLumberjack](https://github.com/s4nchez/LogIO-CocoaLumberjack) A log.io logger for CocoaLumberjack
- [XCDLumberjackNSLogger](https://github.com/0xced/XCDLumberjackNSLogger) CocoaLumberjack logger which sends logs to NSLogger