Contents

ninise/slogger

SLogger is a lightweight and customizable Swift logging utility designed to simplify the process of incorporating logging into your Swift projects.

Features

<ul> <li><strong>Simplicity:</strong> Easily integrate logging into your Swift projects with minimal setup.</li> <li><strong>Flexibility:</strong> Customize log messages, include contextual information, and categorize logs with tags.</li> <li><strong>Performance:</strong> Designed for efficiency with conditional compilation to log only in DEBUG builds.</li> <li><strong>Readability:</strong> Log messages include contextual details like file name, function, and line number for better traceability.</li> </ul>

Usage

  1. Import the package
import SLogger  
  1. Quick and easy usage
Log.info("info", tag: "LOGIN")
Log.debug("debug")
Log.warning("info")
Log.error("error")
Log.verbose("verbose")
  1. Output
[ℹ️ INFO ℹ️] info  ContentView.swift:23 body
[🍀 DEBUG 🍀] debug  ContentView.swift:24 body
[⚠️ WARN ⚠️] info  ContentView.swift:25 body
[🚨 ERROR 🚨] error  ContentView.swift:26 body
[👀 VERBOSE 👀] verbose  ContentView.swift:27 body

Requirements

  • Swift 5.0+

Installation

Swift Package Manager

SLogger is available through Swift Package Manager.

To add package go to File -> Swift Packages -> Add Package Dependancy

https://github.com/Ninise/SLogger.git

Package Metadata

Repository: ninise/slogger

Default branch: main

README: README.md