Skip to content

Light logger 🧐 to use during the development in the Xcode project.

License

Notifications You must be signed in to change notification settings

Kharauzov/PureLogger

Repository files navigation

Swift Platform License

Overview

PureLogger is an elegant replacement of Swift.print() in the Xcode project to use during the debugging.

Presentation

Installation

CocoaPods

pod 'PureLogger'

Manually

Just copy Source folder to your Xcode project.

How To

Method #1 - Globally

After adding the framework to your project, you need to import the module in your AppDelegate class.

import PureLogger

Then add this line just below

let log = Log.shared

After this you can access log istance across all project.

log.debug("Testing debug log")

Method #2 - Locally

After adding the framework to your project, you need to import the module in the every class, you wish to use the logger.

import PureLogger

Then you need to initialise the local logger like this

let log = Log()

After this you can access log istance in the appropriate class.

Available methods

log.debug(...)
log.info(...)
log.warning(...)
log.error(...)

Also you can use such logic, if you want to print only input item itself without any additional information.

Log("Simple log")

Besides this, you can customize emoji, date format and other things at the output information to fit your demands 😉

Feedback

If you have any questions or suggestions, feel free to open issue just at this project.

License

PureLogger and all its classes are available under the MIT license. See the LICENSE file for more info.