Skip to content

Releases: RougeWare/Swift-Simple-Logging

0.5.2 - Better error logging and custom log channel locations

20 Nov 06:22
efdee02
Compare
Choose a tag to compare

Big changes this time!

  • New CombinedLoggable and CombinedLogMessage 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.5.1 - Bumped LazyContainers to 4.0.0 #16
  • 0.5.2 - Changed LazyContainers URL to the current one #18

0.4.4 - New Licensing

22 Jul 01:45
ac1c85a
Compare
Choose a tag to compare

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

14 Jun 22:25
9bcc282
Compare
Choose a tag to compare
Pre-release

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

19 May 22:49
ba6ddeb
Compare
Choose a tag to compare

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

19 May 19:48
Compare
Choose a tag to compare
0.1.0 - First idea Pre-release
Pre-release

A simple logging framework for Swift