Latest 1.2
License MIT
Platforms osx 10.9, ios 8.0


A simple OSLog logger library for macOS and iOS written using Swift. The library uses OSLog on macOS v10.12 and above and iOS 10.0 and above. If the OS version is lower, then it fallbacks to NSLog.


  1. Install using Cocopoads
pod 'JSLogger'
  1. Import the module and create an object or use shared instance
import JSLogger
let log = Logger()
  1. Log using various log levels
log.default("Uses the default log level from OSLog")
log.default("Is visible using as well")"Needs setting debug mode logging in")

log.debug("All logs will be displayed in Xcode debug area")

let errMsg = "Can be used for error logging"

log.fatal("Should not occur")

// Log anything
log.default([3, 1, 4, 1, 5, 9])
  1. Configure logging subsytem and category
let meta = OSLog(subsystem: "com.example", category: "mysticapp")
let log = Logger(meta: meta, level: .debug)
  1. Disable all logging
  1. Using debug level logs only if DEBUG=1 flag is set under build settings which is the default for debug builds

Latest podspec

    "name": "JSLogger",
    "version": "1.2",
    "license": "MIT",
    "summary": "A simple OSLog logger",
    "homepage": "",
    "authors": {
        "jsloop": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.2"
    "documentation_url": "",
    "platforms": {
        "osx": "10.9",
        "ios": "8.0"
    "source_files": "Logger/*.swift",
    "swift_version": "4.2"

Pin It on Pinterest

Share This