WeTransfer / Diagnostics

Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.
MIT License
933 stars 53 forks source link

Add configuration struct (#66) #72

Closed alexiscreuzot closed 3 years ago

alexiscreuzot commented 4 years ago

This is my PR allowing to make reports lighter. I deviated a bit from my original proposition.

Changelog

Added a way to configure logs maximumSize as well as maximumNumberOfSession through a DiagnosticsConfiguration struct.

You can use it likes :

let configuration = DiagnosticsConfiguration(
    maximumSize: 1 * 1024 * 1024, // 1MB
    maximumNumberOfSession: 10)
do {
    try DiagnosticsLogger.setup(configuration: configuration)
} catch {
    print(error.localizedDescription)
}

This is a non-breaking change, as using DiagnosticsLogger.setup() will use the default configuration, which is the same as the current one (2MB maximum size, no maximumNumberOfSession)

alexiscreuzot commented 4 years ago

Hey there, my time is up for open source dev this month but don't hesitate to contact me (alexis at monoqle.fr)

github-actions[bot] commented 3 years ago

This PR is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

wetransferplatform commented 3 years ago
Warnings
:warning: **Sources/DiagnosticsLogger.swift#L152** - It is safer to use weak instead of unowned
:warning: **Sources/DiagnosticsLogger.swift#L187** - It is safer to use weak instead of unowned
Messages
:book: View more details on Bitrise
:book: Diagnostics: Executed 19 tests, with 1 failure (0 unexpected) in 0.129 (0.162) seconds

Diagnostics.framework: Coverage: 41.52

File Coverage
DiagnosticsLogger.swift 54.39%
LogsReporter.swift 72.22%
UIDeviceExtensions.swift 31.03%

Generated by :no_entry_sign: Danger Swift against d42edc5bef58f5fe212bc7936d54ac21e8272a28