Skip to content

Basic OSLog alternative with custom log destinations

Notifications You must be signed in to change notification settings

felfoldy/LogTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LogTools

Swift Version Platform

LogTools is a Swift logging library designed to enhance the existing OSLog system. It allows you to easily integrate custom log destinations such as file streaming, network logging, or built-in console logging without rewriting your entire logging system.

Features

  • Seamless integration with existing OSLog-based logging.
  • Support for multiple log destinations.

Installation

dependencies: [
    .package(url: "https://github.com/felfoldy/LogTools.git", from: "1.1.0")
]

Usage

Change the OSLog import to LogTools:

// import OSLog
import LogTools

let log = Logger(subsystem: "com.your_company.your_subsystem", category: "your_category_name")
            
log.notice("The array contains \(itemCount) items")
log.debug("The user selected the color \(selectedColor)")

You can implement a LogDestination and add it like this:

Logger.destinations.append(NetworkLogDestination())

About

Basic OSLog alternative with custom log destinations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages