swift-log

1.15.0

A Logging API for Swift
apple/swift-log

What's New

1.15.0

2026-08-05T08:55:17Z

What's Changed

SemVer Minor

SemVer Patch

Other Changes

  • Update implemented proposals status by @kukushechkin in #476
  • Bump swiftlang/github-workflows/.github/workflows/soundness.yml from 0.0.11 to 0.0.12 by @dependabot[bot] in #480
  • Bump swiftlang/github-workflows/.github/workflows/soundness.yml from 0.0.12 to 0.0.13 by @dependabot[bot] in #486
  • Document how to construct log handlers that need more than a label by @kukushechkin in #490

New Contributors

Full Changelog: 1.14.0...1.15.0

SwiftLog

This repository contains a logging API implementation for Swift. SwiftLog provides a unified, performant, and ergonomic logging API that can be adopted by libraries and applications across the Swift ecosystem.

Quick Start

The following snippet shows how to add SwiftLog to your Swift Package:

// swift-tools-version: 6.1
import PackageDescription

let package = Package(
    name: "YourApp",
    dependencies: [
        .package(url: "https://github.com/apple/swift-log", from: "1.6.0")
    ],
    targets: [
        .target(
            name: "YourApp",
            dependencies: [
                .product(name: "Logging", package: "swift-log")
            ]
        )
    ]
)

Then start logging:

import Logging

// Create a logger
let logger = Logger(label: "com.example.YourApp")

// Log at different levels
logger.info("Application started")
logger.warning("This is a warning")
logger.error("Something went wrong", metadata: ["error": "\(error)"])

// Add metadata for context
var requestLogger = logger
requestLogger[metadataKey: "request-id"] = "\(UUID())"
requestLogger.info("Processing request")

Available log handler backends

The community has built numerous specialized logging backends.

A great way to discover available log backend implementations is searching the Swift Package Index for the swift-log keyword.

Description

  • Swift Tools 6.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Sep 03 2026 08:47:05 GMT-0900 (Hawaii-Aleutian Daylight Time)