---
title: "#289: Displaying Log Messages in Apps with TinyConsole 📃📲"
url: https://littlebitesofcocoa.com/289-displaying-log-messages-in-apps-with-tinyconsole
author: Jake Marsh
date: 2017-01-16
published: 2017-01-16
topics: ["Libraries"]
description: "Xcode offers a wealth of great tools for debugging. Sometimes though, we'd like to be able to debug or evaluate the inner-workings of our app without..."
---

# #289: Displaying Log Messages in Apps with TinyConsole 📃📲

By Jake Marsh, January 16, 2017. HTML: https://littlebitesofcocoa.com/289-displaying-log-messages-in-apps-with-tinyconsole

**Xcode** offers a wealth of great tools for debugging. Sometimes though, we'd like to be able to debug or evaluate the inner-workings of our app without needing to be connected to **Xcode's debugger.**

Today we'll check out [TinyConsole](https://github.com/Cosmo/TinyConsole) by [Devran Ünal](https://github.com/Cosmo), a library that lets us easily display our log messages directly inside our app. Let's take a look.

We'll install [TinyConsole](https://github.com/Cosmo/TinyConsole) into our app, then slightly modify some code in our `AppDelegate` to set it up.

Instead of assigning our root view controller like this:

``` swift
self.window.rootViewController = SpaceshipsViewController()
```

We'll wrap our root view controller in a `TinyConsoleController`:

``` swift
self.window = TinyConsoleController(
  rootViewController: SpaceshipsViewController()
)
```

That's it. Now all we need to do is add some log messages throughout our code. We can do this with calls like:

``` swift
TinyConsole.print("spacehip id: \(spaceship.id)")
```

Now, we can launch our app and try it out. When running on a device, we can simply shake the device to show/hide the console view.

(**Pro Tip:** Press **⌘⌃Z** to simulate a shake in the **iOS Simulator**).

<p class='break'></p>

<img src="https://media.littlebitesofcocoa.com/289-1.gif" style="max-width: 197px; border-radius: 4px;" />

Neat! [TinyConsole](https://github.com/Cosmo/TinyConsole) doesn't stop there though, we can also use colors:

``` swift
TinyConsole.print("Crew Member Saved!", color: UIColor.green)
```

and add Markers:

``` swift
TinyConsole.addMarker()
```

Finally, there's a few more gestures available (in addition to shaking to hide/show).

We can **swipe** to add a Marker, **tap with 2 fingers** to log something manually, or **tap with 3 fingers** to show an Action Sheet that allows us to send our log messages as an email.

Learn more about [TinyConsole](https://github.com/Cosmo/TinyConsole) at [git.io/tinyconsole]()
