logging-middleware-oslog

1.0.1

Simple OSLog logging middleware
laconicman/OSLogLoggingMiddleware

What's New

Regular

2025-04-07T17:01:33Z

OSLogLoggingMiddleware

Swift Compatibility Platform Compatibility

A logging middleware package for Swift OpenAPI Generator/Runtime that provides detailed request and response logging capabilities. Uses system OSLog. The library is nothing special, just simple reusable package, that you can easily add to a project and remove from it once no longer needed. Or just turn logging off.

Features

  • 📝 Comprehensive request and response logging
  • ⚡️ Pretty printed
  • 🔧 Configurable logging levels and formats
  • 🎯 Non-intrusive middleware design

Installation

Swift Package Manager

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/laconicman/OSLogLoggingMiddleware.git", from: "1.0.0")
]

Then add the dependency to your target:

targets: [
    .target(
        name: "YourTarget",
        dependencies: [
            .product(name: "OSLogLoggingMiddleware", package: "OSLogLoggingMiddleware")
        ]
    )
]

Usage

Basic Setup

import OSLogLoggingMiddleware
import OpenAPIRuntime

let client = Client(
    serverURL: URL(string: "https://api.example.com")!,
    middleware: [
        OSLogLoggingMiddleware()
    ]
)

Contributing

Contributions are welcome!

This is helper package for the following

License

This project is licensed under the Apache License 2.0.

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Thu May 15 2025 23:46:16 GMT-0900 (Hawaii-Aleutian Daylight Time)