Contents

laconicman/oslogloggingmiddleware

A logging middleware package for Swift OpenAPI Generator/Runtime that provides detailed request and response logging capabilities. Uses system OSLog.

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.

Package Metadata

Repository: laconicman/oslogloggingmiddleware

Default branch: main

README: readme.md