Latest 1.0
License MIT
Platforms ios 10.0, requires ARC




Built on top of iOS/OS X os_log SwiftyOSLog makes use of it easy and laconic.


  • Powered by os_log
  • Different logging levels: default, info, debug, error, fault
  • Supports macOS Console GUI or log comman line tool
  • Takes care of a different loggers


Using Cocoapods:

target 'MyApp' do
  pod 'SwiftyOSLog', '~> 1.0'


Import package

import SwiftyOSLog

Initialize logger

Use default logger

let log = SwiftyOSLog.default

or a logger for a specific subsystem and category

let subsystem = Subsystem("com.your_company.subsystem_name")
let category = Category("Chat")
let log = SwiftyOSLog(subsystem: subsystem, category: category)

or let SwiftyOSLogCoordinator manage all your loggers:

let subsystem = Subsystem.current
let category = Category.default
let log = SwiftyOSLogCoordinator.shared.log(for: subsystem, category: category)


Logging mechanism is fully compatible to what’s described at Logging | Apple Developer Documentation.

Log messages should be of StaticString type:"Info message")

In case if you need a more complex message, use format specifiers described at Formatting Log Messages:

log.default("%{public}@", "Formatted message")

Respect privacy

Apple provide developers with two access modifiers: %{public} and %{private}.
Dynamic strings and complex dynammic objects are considered as prived by default and are not collected automatically. More details can be found at Privacy section of Apple Developer Documentation.


This library is licensed under MIT. Full license text is available in LICENSE

Latest podspec

    "name": "SwiftyOSLog",
    "version": "1.0",
    "summary": "A lightweight and easy to use wrapper on top of os_log.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Nikolay Sokhryakov": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "10.0"
    "source": {
        "git": "",
        "tag": "1.0"
    "source_files": "SwiftyOSLog/**/*.{swift}",
    "requires_arc": true,
    "swift_version": "4.2"

Pin It on Pinterest

Share This