Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


A framework in Swift to create and manage log entries in up to 5 destinations and on 8 levels.

SwifterLog is part of the Swiftfire webserver project.

The Swiftfire website

The Reference manual

The Installation manual on or github

The User manual on or github


  • 5 different logging targets:
    1. The OS Log facility (from macOS 10.12 or from iOS 10)
    2. A file
    3. STDOUT (println)
    4. A network destination
    5. A list of callback objects from the Application itself.
  • 8 log levels:
    1. Debug
    2. Info
    3. Notice
    4. Warning
    5. Error
    6. Critical
    7. Alert
    8. Emergency
  • Each logging target can have its own cut-off level for the information that is logged.
  • The file target can be configured to store the log info in a predefined number of files of a predefined maximum size. When the maximum number of files is exceeded, the oldest file will automatically be removed.
  • Included high performance non-evaluation destinations to allow debug logging calls to remain in shipping code
  • Compiles using SPM (Swift Package Manager)
  • Filtering is possible
  • Supports macOS and Linux
  • Keeps logfiles seperate if multiple instances of the same app are executing in parallel.


As an SPM package

To install SwifterLog type the following:

$ git clone

This will create a directory SwifterLog with the project contained in it.

Go down in the directory that was created:

$ cd SwifterLog

Then perform a SPM build.

$ swift build

Adding to an Xcode project

In the Xcode project using the navigator panel select the target SwifterLog should be added to.

Then select the General tab and click the + sign of the Frameworks, Libraries, and Embedded Content section.

In the dropdown window select Add Other... and choose Add Package Dependency....

In the new dropdown window type and click Next, Next and Finish.

Now use import SwifterLog in each source file where you need its capabilities.

Optional removal of Ascii, BRUtils, VJson and SwifterSockets dependency

By default SwifterLog also needs Ascii, BRUtils, VJson and SwifterSockets for the networking target. If the networking target is not needed, that code can be excluded by adding an Active Compilation Condition:

In the xcode project, the SwifterLog framework target, select the Build Settings and under Swift Compiler - Custom Flags add SWIFTERLOG_DISABLE_NETWORK_TARGET to the Active Compiler Conditions.

Also remove the Ascii, BRUtils, VJson and SwifterSockets from the Linked Frameworks and Libraries settings under the General tab for the SwifterLog target.

Version History

No new features planned. Updates are made on an ad-hoc basis as needed to support Swiftfire development.

2.2.2 & 2.2.3

  • Added swift version, platform and a LICENSE file


  • Rewrote dependency on >= macOS 12


  • Added capability to run multiple instances of an app in parallel and still keep the logfiles sperate.


  • Linux compatibility


  • Updated for changes in SwifterSockets: using Swift.Result instead of BRUtils.Result.


  • Documentation updates


  • Udated headers
  • Added defaultTypeString and now allows empty type parameters.


  • Updated manifest to tool v5
  • Added platform to manifest (macOS 10.12)


  • Migration to Swift 5


  • Undid the disabling of time info in Stdout target (not needed)
  • Fixed level-inversion bug that made the newest versions of SwifterLog unworkable


  • Added disabling of time info to Stdout target
  • Added disable/enable settings for OSLog target


  • Made the message parameter implicit


  • Replace ASL with os_log


  • Migration to SPM 4


  • Migration to Swift 4, minor changes.
  • Updated user manual


  • Updated dependecies


  • Split off from 1.0.1, new implementation.


  • Updated dependecies (VJson & SwifterSockets)


  • No changes but this readme file since the previous version.


A framework in Swift to create log entries in up to 5 different types of destinations and at 8 different levels.




You can’t perform that action at this time.