Latest 1.0
Homepage https://github.com/igormatyushkin014/Reportage
License MIT
Platforms ios 9.0
Authors

Reportage








At a Glance

Reportage is a powerful tool that simplifies console output in Xcode.

How To Get Started

  • Copy content of Source folder to your project.

or

  • Use Reportage cocoapod

Requirements

  • iOS 9 and later
  • Xcode 9 and later
  • Swift 4

Usage

Settings

Everything starts with Logger instance. Usually, it’s enough to use the singletone (Logger.shared), but you can create another one with Logger().

Logger is a highly customizable thing. You can setup width of line, offset, prefix and many other things.

Setting Possible values Default value Description
width Any Int value bigger than 0. 40 Maximum width of line. Measured in symbols.
offset Any Int value equal to or bigger than 0. 0 Left offset of logger’s output. Measured in symbols.
offsetPattern Any String value. Space. Pattern to fill the offset’s space with.
dateFormat .date
.time
.dateTime
.custom(value: String)
.none
.dateTime Format of date printed before the message. If .none, date will not be printed.
prefix Any String value. Empty. Prefix of the message. Usually emoji but can be anything else.
uppercased true
false
false Specifies whether message should be uppercased or not.
header .emptyLine
.line(pattern: String)
.custom(text: String)
.none
.none Header that is printed before the message.
footer .emptyLine
.line(pattern: String)
.custom(text: String)
.none
.emptyLine Footer that is printed after the message.

Example of Logger‘s full customization:

Logger.shared
    .width(80)
    .offset(4)
    .offsetPattern(" ")
    .prefix("🚀")
    .dateFormat(.dateTime)
    .uppercased(false)
    .header(.none)
    .footer(.emptyLine)

Output

Sending message to console is incredibly easy:

logger.print("Some message")

Also, you can change output settings on the go:

logger
    .dateFormat(.none)
    .offset(0)
    .prefix("🚀")
    .print("App is launched")
    .dateFormat(.time)
    .offset(20)
    .prefix("🖥")
    .print("Authorization requested")

License

Reportage is available under the Apache 2.0 license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Reportage",
    "version": "1.0",
    "summary": "Logger for iOS",
    "description": "Powerful tool for managing console output in Xcode.",
    "homepage": "https://github.com/igormatyushkin014/Reportage",
    "screenshots": "https://github.com/igormatyushkin014/Reportage/raw/master/Images/logo_2048_2048.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Igor Matyushkin": "[email protected]"
    },
    "social_media_url": "https://twitter.com/imatyushkin1",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/igormatyushkin014/Reportage.git",
        "tag": "1.0"
    },
    "source_files": [
        "Source",
        "Source/**/*"
    ],
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This