Latest 1.1.1
Homepage https://github.com/sebastianvarela/PrettyLogger
License MIT
Platforms ios 10.0, tvos 10.1
Frameworks UIKit
Authors

CocoaPods Compatible
Carthage Compatible
Platform
Platform
Platform
Build Status codecov codebeat badge

Introduction

A pretty set of log functions to print message in console using levels (Debug, Info, Trace, Warning & Error) and emojis to improve visibility 💪

Platforms

Support for iOS, tvOS and macOS

Installation

This framework is compatible with Carthage or Cocoapods, use one of both.

Carthage

Add this into your Cartfile:

github "sebastianvarela/PrettyLogger" 

Cocoapods

Add this into your Podfile:

pod 'PrettyLogger' 

Usage

Print messages

To print a message in the console you simply use any of the global functions:

  logWarning("This a warning!!")
  logError("This is showed as error")
  logFatal("This is showed as fatal message")
  logInfo("This is an info message")
  logDebug("This is a debug message")
  logTrace("This is a trace info")

The previous example will print:

13:31:59.632 ◉ ⚠️⚠️⚠️ This a warning!! [File.swift:L109]
13:31:59.639 ◉ ❌❌❌ This is showed as error [File.swift:L110]
13:31:59.639 ◉ ☠️☠️☠️ This is showed as fatal message [File.swift:L111]
13:31:59.639 ◉ 🔍 This is an info message [File.swift:L112]
13:31:59.639 ◉ 🐛 This is a debug message [File.swift:L113]
13:31:59.640 ◉ ✏️ This is a trace info [File.swift:L114]

Level

You can silent all logs (or some, depending on level) by setting the property level on the shared instance:

PrettyLogger.shared.level = .all //To show all messages
PrettyLogger.shared.level = .disable //To silent logger
PrettyLogger.shared.level = .info //To show all message except debug & trace

The available levels, in order, are: disable, fatal, error, warn, info, debug, trace & all

Global framework

If you want to import all functions in your project without import PrettyLogger in every file you could use this directive in your AppDelegate:

@_exported import PrettyLogger

Latest podspec

{
    "name": "PrettyLogger",
    "version": "1.1.1",
    "summary": "A pretty set of log functions to print message in console using levels and emojis to improve visibility ud83dudcaa",
    "description": "A pretty set of log functions to print message in console using levels (Debug, Info, Trace, Warning & Error) and emojis to improve visibility ud83dudcaa",
    "homepage": "https://github.com/sebastianvarela/PrettyLogger",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Sebastiau0301n Varela": "[email protected]"
    },
    "social_media_url": "http://twitter.com/skirmish84",
    "platforms": {
        "ios": "10.0",
        "tvos": "10.1"
    },
    "source": {
        "git": "https://github.com/sebastianvarela/PrettyLogger.git",
        "tag": "v1.1.1"
    },
    "source_files": [
        "Source",
        "Source/**/*.{swift}"
    ],
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This