Releases: bennokress/PrettyLog
Restore compatibility with Swift 5
Separate Demo App
What's Changed
- Remove the Demo App Product and Target from the Package Definition
Full Changelog: 2.0.2...2.0.3
Small Improvements for v2
What's Changed
- Throwing a warning now if no LogTarget is defined upon trying to log a statement
- Improve README
Full Changelog: 2.0.0...2.0.2
2.0.0
PrettyLog v2 introduces several new features while maintaining backward compatibility except for one small breaking change. Here's what's new and what you need to update:
New Features
1. New Semantic Log Levels
Three new log levels have been added with environment-specific semantics. In our team at work this has been established to make clear which level is appropriate for a log message.
- 🟤
.xcode
- identical to.debug
- 🔵
.staging
- identical to.verbose
- 🟢
.production
- identical to.info
Additionally Key Event Logging was added which is meant to always log without sensitive data, perhaps even to another system, to gain insights and generate statistics.
- 📊
.keyEvent
- Highest priority for critical events (📊)
2. Sensitive Data Logging Support
All logging methods except logK
now support an optional sensitiveMessages
parameter for data that should only be logged in certain environments (configurable for each LogTarget
):
// Before (1.x)
logI("Login", "User ID: \(userID), category: .user)
// After (2.0) - with sensitive data support we could for example log the password to the console, but not in production
logI("Login", "User ID: \(userID), sensitiveMessages: "Password: \(password)", category: .user)
3. Swift 6.1 Compatibility
PrettyLog is now officially compatible with Swift 6.1.
Breaking Change
Log Target Protocol Update
With the new sensitive data, an additional parameter is needed to define a LogTarget
that defines if the target should log or omit sensitive information.
public protocol LogTarget {
/// If `false`, Strings passed to the `log` method as sensitive data will be discarded.
var canLogSensitiveInformation: Bool { get }
// …
}
Optional Changes
- All existing
logD()
,logV()
,logI()
,logW()
,logE()
calls continue to work unchanged, but can be adjusted to the new semantic notation - Global log method definitions from the "Import once" pattern work as before, but can be expanded to support the new functionalities
Full Changelog: 1.1.1...2.0.0
Switch Debug and Verbose Priority Levels
1.1.1 Switch Debug and Verbose Priority Levels
Increase Customization Options
1.1.0 Increase Platform Support
Add customization option to LogLevel
1.0.4 Add customization option to LogLevel
Prepare Swift Package Index Release
1.0.2 Prepare Swift Package Index Release
Improved Readme
1.0.1 Extend Read Me with Custom Log Categories
Initial Release
1.0.0 Initial Release