Emoji-Logger

1.0.2

Light weight Swift logger with severity levels and built in emojis
DubonYaar/Emoji-Logger

What's New

New Features

2020-10-08T09:29:15Z

New API
New Emoji Library
New filter by groups

Emoji-Logger

a a

Overview

Light weight Swift console logger with sevirity levels and built in Emojis

Installation

Manually

  • Clone this git
  • Drag Logger.swift file into xCode
  • Select "Copy Files" from dialog

CocoaPods

Add the following line to your Podfile:

pod 'Emoji-Logger'

Carthage

Add the following line to your Cartfile:

github "alongenosar/Emoji-Logger"

Usage

Swift Examples.

Set Logger sevirity output level

Logger.logLevel = .info

Log with sevirity 'info'

Logger.log(level:.info,"message","more information")

//You can also omit the level as .info is the default sevirity level

Logger.log("message","more information")

//Or

Logger.info("message","more information")

In the Debug window this will result with

🔵info: message more information

Log with sevirity 'warning'

Logger.log(level:.warning,"warning message","more warning information")

//Or 

Logger.warning("warning message","more warning information")

In the Debug window this will result with:

🔶warning: warning message more warning information

Log with sevirity 'error'

Logger.log(level:.error,"error message,","more stuff")

//Or

Logger.error("error message,","more stuff")

In the Debug window this will result with

🔴error: error message, more stuff

Override message prefix regardless to its sevirity level

Logger.log("apple message",["foo:"bar"],prefixOverride:"🍏apple:")

in debug area

🍏apple: apple message {"foo":"bar"}

Change level prefix

Logger.set(prefix: "** ERROR **", forLevel: .error)  

Logger.error("error message,"more stuff")
//in debug area
** ERROR ** error message, more stuff

Mute/Unmute level: Suppresses logs from a certain level/s

Logger.mute(level:.info)

Logger.unmute(level.info

Logger.muteAllBut(level:.info)

Logger.unmuteAll()

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Oct 21 2024 18:21:58 GMT-0900 (Hawaii-Aleutian Daylight Time)