Releases: RougeWare/Swift-Simple-Logging
0.5.2 - Better error logging and custom log channel locations
Big changes this time!
- New
CombinedLoggable
andCombinedLogMessage
to combine two messages in one log line - Added new log channel location:
.custom
, which takes one function that you can use to implement your own location - Replaced the confusing minimum log severity with a semantic
LogSeverityFilter
- Removed a bunch of odd log severity names. If you want these, feel free to implement them yourself - it's just a couple lines 😁
- Added
LoggableError
to aide in logging errors - It now depends on
FunctionTools
for the new custom log channel location
Patch Changes
0.4.4 - New Licensing
License is now split into two semantic licenses depending on the entity obtaining the license.
Non-licensing patch changes
- 0.4.4
- Added a dynamic library product whose name is a valid bundle identifier
- Deprecated previous dynamic library product because its name caused problems when submitting to the App Store
- 0.4.3
- Added alternative dynamic library product
0.3.0 - Better error logging
Logging errors works much better now! Not only does log(error:)
have a special variant for taking an error, but there's also a new log function log(errorIfThrows:backup:)
, which gracefully handles errors, both with a log message iff the given call throws, and with a backup if it's needed:
myVeryGoodFunction(count: log(errorIfThrows: try readCountFromDisk(), backup: 0))
That's one line to both handle an error and provide a backup without ignoring the error! Here's what that same operation would look like without this:
do {
myVeryGoodFunction(count: try readCountFromDisk())
}
catch {
log(error: error)
myVeryGoodFunction(count: 0)
}
And sure, you could use try?
and ??
, but then you ignore the error entirely. Personally, I see myself using this log function quite often 😄
Additional Fixes
This release also fixes #4, where the file/line/function were not actually being logged. Whoops!
0.2.1 - Non-specialized `log` functions no longer have labels on the message parameter
Before:
log(severity: .critical, loggable: "Important message")
log(severity: .trace, any: notableObject)
Now:
log(severity: .critical, "Important message")
log(severity: .trace, notableObject)
Patch Changes
0.2.1
- Added GitHub Actions, only imported CoreGraphics on non-desktop Apple platforms
0.1.0 - First idea
A simple logging framework for Swift