{"id":13465856,"url":"https://github.com/hemangshah/printer","last_synced_at":"2026-03-05T23:16:17.518Z","repository":{"id":56933015,"uuid":"89585594","full_name":"hemangshah/printer","owner":"hemangshah","description":"A fancy logger yet lightweight, and configurable. 🖨","archived":false,"fork":false,"pushed_at":"2020-03-11T03:21:25.000Z","size":1602,"stargazers_count":66,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-08T15:28:55.145Z","etag":null,"topics":["disable-logging","emoji","fancy","filter-logs","log","logger","logging","nslog","print","printer","printer-logger","printer-logs","trace"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hemangshah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-27T10:26:19.000Z","updated_at":"2022-12-07T03:18:44.000Z","dependencies_parsed_at":"2022-08-21T00:40:25.716Z","dependency_job_id":null,"html_url":"https://github.com/hemangshah/printer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemangshah%2Fprinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemangshah%2Fprinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemangshah%2Fprinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemangshah%2Fprinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemangshah","download_url":"https://codeload.github.com/hemangshah/printer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222091638,"owners_count":16929668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disable-logging","emoji","fancy","filter-logs","log","logger","logging","nslog","print","printer","printer-logger","printer-logs","trace"],"created_at":"2024-07-31T15:00:36.320Z","updated_at":"2025-10-28T15:14:15.980Z","avatar_url":"https://github.com/hemangshah.png","language":"Swift","readme":"📣📣 \u003cb\u003eImportant\u003c/b\u003e: Printer can only print console logs if you're running an app in the Simulator. If you're running in a real device it will not print any of the logs in console, however, you can always access all logs using [PrinterViewController](#printerviewcontroller) within your app. Printer is using \u003cb\u003e`print`\u003c/b\u003e function internally which is more [effective and speedy](https://stackoverflow.com/questions/25951195/swift-print-vs-println-vs-nslog) then \u003cb\u003e`NSLog`.\u003c/b\u003e\n\n![Fancy Logo](https://github.com/hemangshah/printer/blob/master/PrinterExampleApp/PrinterExampleApp/printer-logo.png)\n\n[![Build Status](https://travis-ci.org/hemangshah/printer.svg?branch=master)](https://travis-ci.org/hemangshah/printer)\n![License](https://img.shields.io/badge/License-MIT-lightgrey.svg)\n![Platform](https://img.shields.io/badge/Platforms-iOS-red.svg)\n![Swift 4.x](https://img.shields.io/badge/Swift-4.x-blue.svg)\n![CocoaPods](https://img.shields.io/cocoapods/dt/printer-logger.svg)\n![MadeWithLove](https://img.shields.io/badge/Made%20with%20%E2%9D%A4-India-green.svg)\n[![Awesome-Swift](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/matteocrippa/awesome-swift/)\n\n## You can print the following types of logs with Printer.\n\n  - ✅ Success\n  - ❌ Error\n  - 🚧 Warning\n  - 📣 Information\n  - 🚨 Alert\n\n\u003e With each type, it will print a particular emoji and titles which will help you to easily identify what the log is. Moreover, it will look cool too.\n\n## Installation\n\n1.**Manually** - Add Printer folder to your Project. All set. If you don't want [PrinterViewController](#printerviewcontroller) only add `Printer.swift`.\n\n2.**CocoaPods**:\n\n    pod 'printer-logger'\n\n3.**Carthage** [Coming soon]. [Reference](https://medium.com/@filippotosetto/how-to-create-a-carthage-framework-8d9d65f98ac2)\n\n\u003e You can read the [CHANGELOG](https://github.com/hemangshah/printer/blob/master/CHANGELOG.md) file for a particular release.\n\n## Features\n\n1.\t[Different ways to print Logs](#different-ways-to-print-logs)\n3.\t[Plain Logs](#plainlog)\n4.\t[Tracing](#tracing)\n5.\t[All Logs for Print](#all-logs-for-print)\n6.\t[All Logs for Use](#all-logs-for-use)\n7.  [PrinterViewController](#printerviewcontroller)\n7.\t[Save Logs to a file](#save-logs-to-a-file)\n8.\t[Flush](#flush)\n9.\t[Customize Printer](#customize-printer)\n10.\t[Filter Logs](#filter-logs-filter-by-log-types)\n11.\t[Disable Logs](#disable-logs)\n12.\t[Completion Block](#completion-block)\n14. [Background or Foreground Logs](#background-or-foreground-logs)\n13.\t[Shipping to AppStore?](#ready-to-ship-your-app)\n\n## Extras\n\n1. [ToDos](#todos)\n2. [Credits](#credits)\n3. [Thanks](#thank-you)\n4. [License](#license)\n\n## Let's see what you can do with Printer.\n\n\u003cb\u003ePrinter has a singleton, you should always use it with its singleton.\u003c/b\u003e\n\n    Printer.log.show(id: \"001\", details: \"This is a Success message.\", logType: .success)\n        \n\u003cb\u003eSee the output. Isn't it cool?\u003c/b\u003e\n        \n    [✅ Success] [⌚04-27-2017 10:39:26] [🆔 101] ➞ ✹✹This is a Success message.✹✹\n        \n\u003cb\u003eHere are other options you can do with Printer.\u003c/b\u003e\n\n    Printer.log.show(id: \"002\", details: \"This is a Error message.\", logType: .error)\n    Printer.log.show(id: \"003\", details: \"This is an Information message.\", logType: .information)\n    Printer.log.show(id: \"004\", details: \"This is a Warning message.\", logType: .warning)    \n    Printer.log.show(id: \"005\", details: \"This is an Alert message.\", logType: .alert)\n\n\u003cb\u003eOutput:\u003c/b\u003e\n\n    [❌ Error] [⌚04-27-2017 10:41:39] [🆔 102] ➞ ✹✹This is a Error message.✹✹\n    [🚧 Warning] [⌚04-27-2017 10:41:39] [🆔 103] ➞ ✹✹This is a Warning message.✹✹\n    [📣 Information] [⌚04-27-2017 10:41:39] [🆔 104] ➞ ✹✹This is an Information message.✹✹\n    [🚨 Alert] [⌚04-27-2017 10:41:39] [🆔 105] ➞ ✹✹This is an Alert message.✹✹\n\n## Different ways to print logs.\n\n\u003cb\u003eDon't want to specify the logType everytime? No problem, we have function for that too.\u003c/b\u003e\n    \n    Printer.log.success(id: \"101\", details: \"This is a Success message. No need to specify logType.\")\n    Printer.log.error(id: \"102\", details: \"This is an Error message. No need to specify logType.\")\n    Printer.log.warning(id: \"103\", details: \"This is a Warning message. No need to specify logType.\")\n    Printer.log.information(id: \"104\", details: \"This is an Information message. No need to specify logType.\")\n    Printer.log.alert(id: \"105\", details: \"This is an Alert message. No need to specify logType.\")\n\n\u003cb\u003eDon't want to specify IDs? We have taken care of that too.\u003c/b\u003e\n\n    Printer.log.success(details: \"This is a Success message without ID.\")\n    Printer.log.error(details: \"This is an Error message without ID.\")\n    Printer.log.warning(details: \"This is a Warning message without ID.\")\n    Printer.log.information(details: \"This is an Information message without ID.\")\n    Printer.log.alert(details: \"This is an Alert message without ID.\")\n\n\u003cb\u003eWe have overrided the 'show' function.\u003c/b\u003e\n\n    Printer.log.show(details: \"This is a Success message.\", logType: .success)\n    Printer.log.show(details: \"This is an Alert message.\", logType: .alert)\n    \n\u003cb\u003eShow a future log.\u003c/b\u003e\n\n    Printer.log.showInFuture(id: \"006\", details: \"This is a future Success message.\", logType: .success, afterSeconds: 3)\n    \n\u003e This will print a log after specified seconds. In this case, success log after three (\u003cb\u003e3\u003c/b\u003e) seconds.\n\n## plainLog\n\n\u003cb\u003eDon't like the fancy logs? No worries, we have a plain log option.\u003c/b\u003e\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.plainLog = true\n    \n\u003cb\u003eExample when \u003c/b\u003e`plainLog`\u003cb\u003e is set to \u003c/b\u003e`true`\u003cb\u003e.\u003c/b\u003e\n\n    [04-27-2017 10:50:30] ID ➞ 001 Details ➞ This is a Success message.\n    [04-27-2017 10:50:30] ID ➞ 002 Details ➞ This is a Error message.\n    [04-27-2017 10:50:30] ID ➞ 003 Details ➞ This is an Information message.\n    [04-27-2017 10:50:30] ID ➞ 004 Details ➞ This is a Warning message.\n    [04-27-2017 10:50:30] ID ➞ 005 Details ➞ This is an Alert message.\n    \n\u003cb\u003eWe have a new\u003c/b\u003e`.plain`\u003cb\u003e type added with \u003c/b\u003eshow()\u003cb\u003e function\u003c/b\u003e.\n\n    Printer.log.show(id: \"001\", details: \"This is a Plain message.\", logType: .plain)\n    \n\u003e This is useful when you only want a few plain logs.\n\n\u003e **IMPORTANT**: Any properties you're setting should be set in advance or before printing any logs to get the exact effect.\n\n\u003e **SUGGESTION**: You can always set all the properties to customize the **Printer** in `AppDelegate.swift` file,\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n            // Override point for customization after application launch.\n\n            //set the properties and call the specific function as per the need.\n\n            //Printer.log.plainLog = true\n            Printer.log.addLineAfterEachPrint = true\n            Printer.log.capitalizeTitles = true\n            Printer.log.capitalizeDetails = true\n            Printer.log.printOnlyIfDebugMode = true\n            \n           //Applied filters to only print success and alert type logs.\n           //Printer.log.filterLogs = [.success, .alert]\n           \n            Printer.log.onLogCompletion = { (log) in\n              //print(log)\n              //print(log.0)\n            }\n\n            //Printer.log.hideTitles()\n            //Printer.log.hideEmojis()\n\n            return true\n        }\n\n\u003e This will set the properties globally and will be available for the entire app life cycle.\n\n## Tracing\n\n\u003cb\u003e Want to print the file name, function name and line number?\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be call everytime when you want to print a trace.\n\n    Printer.log.trace()\n    \n    Printer.Trace ➞ [05-02-2017 14:58:38] ViewController.swift ➞ viewDidLoad() #40\n\n## Auto Tracing\n\n\u003e **DEFAULT**: `true`\n\u003e **IMPORTANT**: `keepAutoTracing` should set to `true` before logging.\n\nThis would print same trace as if you call trace(). If you don't like it, just set `keepAutoTracing` to `false`.\n    \n## All Logs for Print\n\n\u003cb\u003eWant to print all the logs for a different use case?\u003c/b\u003e\n\n\u003e **IMPORTANT**: `keepTracking` should be set to `true` before logging. Even if `keepAutoTracing` is set to `false`; if you pass `showTrace` to `true`, you will see the traced info. This is helpful if you don't want to trace while logging.\n\n    Printer.log.all(showTrace: true)\n    \n    [All Logs] [Success] [05-15-2017 14:28:03] Id:001 Details:This is a Success message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #58\n    [All Logs] [Error] [05-15-2017 14:28:03] Id:002 Details:This is a Error message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #59\n    [All Logs] [Information] [05-15-2017 14:28:03] Id:003 Details:This is an Information message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #60\n    [All Logs] [Warning] [05-15-2017 14:28:03] Id:004 Details:This is a Warning message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #61\n    [All Logs] [Alert] [05-15-2017 14:28:03] Id:005 Details:This is an Alert message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #62\n    \n\u003cb\u003eYou can filter them as well.\u003c/b\u003e\n\n    Printer.log.all(filterLogTypes: [.alert], showTrace: true)\n   \n\u003e This will only print `.alert` type tracked logs with tracing info.\n\n    [All Logs] [Alert] [05-15-2017 14:28:03] Id:005 Details:This is an Alert message.\n    [Trace] ➞ ViewController.swift ➞ viewDidLoad() #62\n    \n\u003e all() function will always print plain logs. \u003ci\u003eNo fancy logs\u003c/i\u003e.\n\n## All Logs for Use\n\n\u003cb\u003eWant to get all the logs?\u003c/b\u003e\n\n    //let array = Printer.log.getAllLogs()\n    let array = Printer.log.getAllLogs(filterLogTypes: [.success])\n    if !array.isEmpty {\n        array.forEach({ (log) in\n             print(log.details)\n            //or do something else.\n        })\n    }\n\n\u003cb\u003eUse cases:\u003c/b\u003e\n- To store it somewhere.\n- To make API calls with log details.\n- To do anything which [Printer] isn't supports.\n\n# PrinterViewController\n\n\u003cb\u003eSee all the printer logs in \u003c/b\u003e `PrinterViewController`\u003cb\u003e. You can also filter the logs within the view controller.\u003c/b\u003e\n\n\u003e **IMPORTANT**: `PrinterViewController` is based on the set properties for `Printer` and works exactly the same, so please be mindful of the properties that you have set.\n\n\u003cb\u003eUse cases:\u003c/b\u003e\n- To see all the logs inside your application while testing the app either on iDevice or a Simulator.\n- No need to check Xcode or Console.\n\n\u003cb\u003eFeatures:\u003c/b\u003e\n- Filter Logs based on types.\n- Copy a particular log.\n- Easy to setup.\n\n- [x] Search Logs.\n\n[**Upcoming**]\n\n- [ ] Send a Log file over email.\n- [ ] Set Properties within the log file. Example: Plain Log [Switch On/Off] *Like that!*\n- [ ] Clear logs.\n- [ ] Air Print.\n- [ ] See all the log files.\n- [ ] Log files management.\n- [ ] Export Text Log files to a PDF.\n\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src = \"https://github.com/hemangshah/printer/blob/master/PrinterExampleApp/Screenshots/PrinterVC-2.png\" alt = \"All Logs\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src = \"https://github.com/hemangshah/printer/blob/master/PrinterExampleApp/Screenshots/PrinterVC-3.png\" alt = \"No Logs\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src = \"https://github.com/hemangshah/printer/blob/master/PrinterExampleApp/Screenshots/PrinterVC-4.png\" alt = \"Alert Logs\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cb\u003eHow to use?\u003c/b\u003e\n\nIf you prefer manual installation.\n\n\u003e You can always use Printer without PrinterViewController. But it's suggestible to add this class for better logging.\n\n1. Add `PrinterTableViewCell.swift`, `PrinterViewController.swift`, `Printer.storyboard` and `Printer.swift` in your Project. You can simply add **Printer** folder as well.\n2. Everything is added, so now copy and paste the code below to present `PrinterViewController` from your app.\n\n\u003e Always add it to someplace (example: navigation bar, side menu, tabbar, app settings) from where you can always present it during development.\n\n        let printerStoryboard = UIStoryboard.init(name: \"Printer\", bundle: Bundle.main)\n        let navcontroller = UINavigationController.init(rootViewController: (printerStoryboard.instantiateViewController(withIdentifier: \"PrinterViewControllerID\")))\n        self.present(navcontroller, animated: true, completion: nil)\n\n## Save Logs to a File\n\n\u003cb\u003eWant to create a log file for use? We have covered it too.\u003c/b\u003e\n\n    let array = Printer.log.getAllLogs()\n    if !array.isEmpty {    \n        Printer.log.saveLogToFile(logs: array)\n    }        \n\n\u003e All your logs will be created in a separate file under Printer folder.\n\n\u003cb\u003eDelete all Log files?\u003c/b\u003e\n\n    Printer.log.deleteLogFiles()\n    \n## Flush\n\n\u003cb\u003eWant to delete all the log files and free up some space?\u003c/b\u003e\n\n    Printer.log.flush()\n\n## Customize Printer\n\n\u003cb\u003eYou can add a line after each logs.\u003c/b\u003e\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: Should be called in advance.\n    \n    Printer.log.addLineAfterEachPrint = true\n\n\u003cb\u003eExample: when addLineAfterEachPrint is set to \u003c/b\u003e`true`\u003cb\u003e.\u003c/b\u003e\n\n    [✅ Success] [⌚04-27-2017 10:53:28] [🆔 001] ➞ ✹✹This is a Success message.✹✹\n    ________________________________________________________________________________________\n    [❌ Error] [⌚04-27-2017 10:53:28] [🆔 002] ➞ ✹✹This is a Error message.✹✹\n    ________________________________________________________________________________________\n    [📣 Information] [⌚04-27-2017 10:53:28] [🆔 003] ➞ ✹✹This is an Information message.✹✹\n    ________________________________________________________________________________________\n    [🚧 Warning] [⌚04-27-2017 10:53:28] [🆔 004] ➞ ✹✹This is a Warning message.✹✹\n    ________________________________________________________________________________________\n    [🚨 Alert] [⌚04-27-2017 10:53:28] [🆔 005] ➞ ✹✹This is an Alert message.✹✹\n    ________________________________________________________________________________________\n\n## Capitalize Titles \u0026 Details\n\n\u003cb\u003eYou can even capitalize the title and details of logs.\u003c/b\u003e\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.capitalizeTitles = true\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.capitalizeDetails = true\n\n\u003cb\u003eExample: when capitalizeTitles and capitalizeDetails are set to \u003c/b\u003e`true`\u003cb\u003e.\u003c/b\u003e\n\n    [✅ SUCCESS] [⌚04-27-2017 11:09:37] [🆔 001] ➞ ✹✹THIS IS A SUCCESS MESSAGE.✹✹\n\n\u003cb\u003eDon't want to show Emojis?\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.hideEmojis()\n\n\u003cb\u003eExample: when\u003c/b\u003e `hideEmojis()` \u003cb\u003ecalled.\u003c/b\u003e\n\n    [Success] [04-27-2017 11:08:45] [001] ➞ ✹✹This is a Success message.✹✹\n    [Error] [04-27-2017 11:08:45] [002] ➞ ✹✹This is a Error message.✹✹\n    [Information] [04-27-2017 11:08:45] [003] ➞ ✹✹This is an Information message.✹✹\n    [Warning] [04-27-2017 11:08:45] [004] ➞ ✹✹This is a Warning message.✹✹\n    [Alert] [04-27-2017 11:08:45] [005] ➞ ✹✹This is an Alert message.✹✹\n\n\u003cb\u003eDon't want to show Titles?\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.hideTitles()\n    \n\u003cb\u003eDon't want to show Log Time?\u003c/b\u003e\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.hideLogsTime = true\n\n## Customize Emojis\n\n\u003cb\u003eDon't like the current Emojis? You can override the default Emojis with your favorite Emojis.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.successEmojiSymbol = \"🎃\"\n\n\u003cb\u003eOther properties for Emoji customization.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.errorEmojiSymbol = \"\u003cSetNew\u003e\"    \n    Printer.log.warningEmojiSymbol = \"\u003cSetNew\u003e\"    \n    Printer.log.infoEmojiSymbol = \"\u003cSetNew\u003e\"    \n    Printer.log.alertEmojiSymbol = \"\u003cSetNew\u003e\"\n\n## Customize Titles\n\n\u003cb\u003eDon't like the current Titles or localize Titles? Want to set your own? You can do this.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.successLogTitle = \"Hurray!!\"\n\n\u003cb\u003eOther properties for Titles customization.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.errorLogTitle = \"\u003cSetNew\u003e\"    \n    Printer.log.warningLogTitle = \"\u003cSetNew\u003e\"    \n    Printer.log.infoLogTitle = \"\u003cSetNew\u003e\"    \n    Printer.log.alertLogTitle = \"\u003cSetNew\u003e\"\n\n## Customize Symbols\n\n\u003cb\u003eDon't like the current Symbols? Want to set your own? You can do this.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.arrowSymbol = \"⇨\"\n    \n\u003cb\u003eOther properties for Symbol customization.\u003c/b\u003e\n\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.starSymbol = \"\u003cSetNew\u003e\"\n\n\u003cb\u003eDon't like the date format in logs? You can change it too.\u003c/b\u003e\n\n\u003e **DEFAULT**: `MM-dd-yyyy HH:mm:ss`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.logDateFormat = \"hh:mm:ss a\"\n\n\u003cb\u003eExample when logDateFormat is set to a different format.\u003c/b\u003e\n\n    [✅ Success] [⌚11:12:23 AM] [🆔 001] ➞ ✹✹This is a Success message.✹✹\n   \n## Filter Logs: Filter by Log Types\n\u003cb\u003eShow specific logs with filter.\u003c/b\u003e\n\n    Printer.log.filterLogs = [.success, .alert]\n \n\u003e This should only print logs of the specified types. I.e. Succes and Alert. All other logs will be ignored.\n\n## Filter Logs: Filter by File\n\u003cb\u003eWritten Printer logs everywhere? Want to Skip logging for \u003c/b\u003e `LoginViewController.swift`\u003cb\u003e for security?\u003c/b\u003e\n\nTo Skip logs for a file: `Printer.log.skipFile()`\nTo Add logs for a file:  `Printer.log.addFile()`\n\n\u003e **IMPORTANT**: You should call `addFile()` to start printing logs for the same file for which you have called `skipFile()`. This is other than the `disable` property which completely disables logging for all the files.\n\n## Disable Logs\n\u003cb\u003eTo disable all logs.\u003c/b\u003e\n\n\u003e **DEFAULT**: `false`\n\u003e **IMPORTANT**: You can set this anywhere and it should not print logs from where it was set.\n\n    Printer.log.disable = true\n    \n## Completion Block\n\u003cb\u003eLet you will notified in advance before any logging events.\u003c/b\u003e\n\n\u003e **IMPORTANT**: This block will ignore all the filters applied for Printer, meaning, it will always notify you for any logs that will print or not print.\n\n        Printer.log.onLogCompletion = { (log) in\n            print(log)\n            //print(log.0)\n        }\n        \nWill return current log, file name, function name, and line number. You can access it with log.0, log.1 and so on.\n\n\u003c/b\u003eUse cases:\u003c/b\u003e\n\n- To notify in advance before a log event.\n- To print logs even if you've applied any filter. \n- To call your APIs to store log information. Only code at one place. No dependencies.\n\n\u003e You will not get notified if `disable` is set to `true` or `printOnlyIfDebugMode` is set to `true` and if your app is in `release` mode.\n\n## Background or Foreground Logs\n\n\u003cb\u003eWant to see a log of when your app goes to the background or foreground?\u003c/b\u003e\n\n    Printer.log.addAppEventsHandler()\n    \n    [📣 INFORMATION] [⌚05-17-2017 13:17:38]  ➞ ✹✹App is in foreground now.✹✹\n    ________________________________________________________________________________________\n    \n\u003cb\u003eStop logging for background or foreground events?\u003c/b\u003e\n\n    Printer.log.removeAppEventsHandler()\n    \n\u003e This is helpful when you're checking all the logs and want to see what happended after app went to background or comes to foreground?\n\n## Ready to ship your app?\n\n\u003cb\u003eDon't want to print the logs in RELEASE mode?\u003c/b\u003e\n\n\u003e **DEFAULT**: `true`\n\u003e **IMPORTANT**: Should be called in advance.\n\n    Printer.log.printOnlyIfDebugMode = false\n    \n## To-Do List\n\n- [x] Filter Logs.\n- [x] Disable Logs.\n- [x] Manual Tracing.\n- [x] Auto Tracing.\n- [x] All logs - Track all logs and print them all at once.\n- [x] Future Logs – A function which will print a log after a certain time.\n- [x] Skipping logs for a particular file.\n- [x] Delegate calls to let you know the Printer logged.\n- [x] Maintain a log file separately.\n- [x] Improve README file with following: Features List for direct link to a particular point.\n- [x] Log application events. Example: Background/Foreground events.\n- [x] Open a ViewController to show up all the logs. \n- [ ] Upcoming features of [PrinterViewController](#printerviewcontroller).\n\n\u003cb\u003eHave an idea for improvements of this class?\nPlease open an [issue](https://github.com/hemangshah/printer/issues/new).\u003c/b\u003e\n    \n## Credits\n\n\u003cb\u003e[Hemang Shah](https://about.me/hemang.shah)\u003c/b\u003e\n\n**You can shoot me an [email](http://www.google.com/recaptcha/mailhide/d?k=01IzGihUsyfigse2G9z80rBw==\u0026c=vU7vyAaau8BctOAIJFwHVbKfgtIqQ4QLJaL73yhnB3k=) to contact.**\n   \n## Thank You!!\n\nSee the [contributions](https://github.com/hemangshah/printer/blob/master/CONTRIBUTIONS.md) for details.\n\n## License\n\nThe MIT License (MIT)\n\n\u003e Read the [LICENSE](https://github.com/hemangshah/printer/blob/master/LICENSE) file for details.\n","funding_links":[],"categories":["Libs","Logging [🔝](#readme)"],"sub_categories":["Logging"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemangshah%2Fprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemangshah%2Fprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemangshah%2Fprinter/lists"}