Customizable Console UI overlay with debug log on top of your iOS App

Related tags

Logging AEConsole
Overview

Swift 5.1 Platforms iOS CocoaPods Carthage Swift Package Manager License MIT

AEConsole

Customizable Console UI overlay with debug log on top of your iOS App

AEConsole is built on top of AELog, so you should probably see that first.

I wanted to see what's happening 'under the hood' while testing some app AFK (ex. outside). Then I made it possible. Hope you'll like it too, happy coding!

AEConsole

Index

Features

  • All the things from AELog plus:
  • Console UI overlay on top of your App
  • Debug log on device in real time
  • Automatic row height for all log lines
  • Forward touches to your App
  • Shake to toggle Console UI
  • Filter log to find exactly what you need
  • Export log to file if you need it for later
  • Share log file easily via system sharing sheet
  • Customize look as you like it

Usage

Calling Console.shared.configure(in: window) will add Console.View as a subview to your App's window and make it hidden by default. Whenever you need Console UI, you just make a shake gesture and it's there! When you no longer need it, shake again and it's gone.

The rest is up to AELog's logging functionality. Whatever is logged with it, will show up in Console.View.

// MARK: - Console configuration

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
    /// - Note: Access Console settings
    let settings = Console.shared.settings

    /// - Note: Customize Console settings like this, these are defaults:
    settings.isShakeGestureEnabled = true
    settings.backColor = UIColor.black
    settings.textColor = UIColor.white
    settings.fontSize = 12.0
    settings.rowSpacing = 4.0
    settings.opacity = 0.7

    /// - Note: Configure Console in app window (it's recommended to skip this for public release)
    Console.shared.configure(in: window)

    /// - Note: Log something with AELog
    aelog()

    return true
}
// MARK: - Additional Console API

/// - Note: Check if Console is hidden
Console.shared.isHidden

/// - Note: Toggle Console visibility
Console.shared.toggle()

/// - Note: Add any log line manually
Console.shared.addLogLine(line: "Hello!")

/// - Note: Export log file manually
Console.shared.exportLogFile { (fileURL) in
    do {
        let url = try fileURL()
        /// - Note: do something with a log file at given file URL...
    } catch {
        print(error)
    }
}

Quick Help

This should explain all the features of Console UI:

AEConsole

Feature Description
Export Log will make AELog_{timestamp}.txt file in Application Documents directory and present sharing sheet.
Filter Log filter is not case sensitive.
Toggle Toolbar works for both filter and menu toolbars simultaneously.
Toggle Forward Touches when active you can interact with your App, otherwise you can interact with the log.
Toggle Auto Follow when active it will automatically scroll to the new log lines, otherwise it will stay put.
Clear Log you can't undo this.
Pan Gesture over Menu Toolbar left is more transparent, right is more opaque.

Installation

License

AEConsole is released under the MIT license. See LICENSE for details.

You might also like...
Swift library for working with Debug Adapter Protocol (DAP)

DebugAdapterProtocol This is a Swift library for interacting with Debug Adapter Protocol. It contains type definitions and utilities useful for both s

JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available.
JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available.

JustLog JustLog takes logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support f

Delightful console output for Swift developers.
Delightful console output for Swift developers.

Rainbow adds text color, background color and style for console and command line output in Swift. It is born for cross-platform software logging in te

🍯 Awesome log aggregator for iOS
🍯 Awesome log aggregator for iOS

🍯 Awesome log aggregator for iOS

Puree is a log collector which provides some features like below
Puree is a log collector which provides some features like below

Puree Description Puree is a log collector which provides some features like below Filtering: Enable to interrupt process before sending log. You can

Log every incoming notification to view them again later, also includes attachments and advanced settings to configure

Vē Natively integrated notification logger Installation Add this repository to your package manager

A custom logger implementation and Task Local helper for swift-log

LGNLog A custom logger implementation and TaskLocal helper for Swift-Log. Why and how This package provides two and a half things (and a small bonus):

A log should tell a story, not drown the reader in irrelevance.

StoryTeller A log should tell a story, not drown the reader in irrelevance Story Teller is an advanced logging framework that takes an entirely differ

A logging backend for swift-log that sends logging messages to Logstash (eg. the ELK stack)
A logging backend for swift-log that sends logging messages to Logstash (eg. the ELK stack)

LoggingELK LoggingELK is a logging backend library for Apple's swift-log The LoggingELK library provides a logging backend for Apple's apple/swift-log

Comments
  • Dismisses keyboard when logging

    Dismisses keyboard when logging

    Whenever I log something, this line is called and it removes focus from any UITextFields and thus dismisses the keyboard:

    https://github.com/tadija/AEConsole/blob/1f9a7ac78a185d8f53e2e4867b82322a880d417a/Sources/AEConsole.swift#L91

    opened by wgrand 2
  • Ho to manually export log to file

    Ho to manually export log to file

    Hi,

    there is a button, in AECOnsole, to export logs values, to a file, in document app folder.

    how can I do that by code (swift, if possible) ?

    I don't know how to contact you, so I posted a issue,

    sorry for that

    thanks Olivier

    opened by olivier38070 1
  • Loading logs

    Loading logs

    Thank you very much for sharing this awesome project. I’d like to request a feature; loading existing log file. In a smart way that shows last x lines of log by default but supports scrolling up to see more ( load more)

    enhancement help wanted 
    opened by wamra 0
Owner
Marko Tadić
keep it simple
Marko Tadić
Automate box any value! Print log without any format control symbol! Change debug habit thoroughly!

LxDBAnything Automate box any value! Print log without any format control symbol! Change debug habit thoroughly! Installation You only need drag LxD

DeveloperLx 433 Sep 7, 2022
📱💬🚦 TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.

TinyConsole TinyConsole is a tiny log console to display information while using your iOS app and written in Swift. Usage Wrap your Main ViewControlle

Devran Cosmo Uenal 2k Jan 3, 2023
Gedatsu provide readable format about AutoLayout error console log

Gedatsu Gedatsu provide readable format about AutoLayout error console log Abstract At runtime Gedatsu hooks console log and formats it to human reada

bannzai 520 Jan 6, 2023
Gedatsu provide readable format about AutoLayout error console log

Gedatsu Gedatsu provide readable format about AutoLayout error console log Abstract At runtime Gedatsu hooks console log and formats it to human reada

bannzai 475 Jun 24, 2021
A Swift-based API for reading from & writing to the Apple System Log (more commonly known somewhat inaccurately as "the console")

CleanroomASL Notice: CleanroomASL is no longer supported The Apple System Log facility has been deprecated by Apple. As a result, we've deprecated Cle

Gilt Tech 62 Jan 29, 2022
Simple Design for Swift bridge with Javascript. Also can get javascript console.log.

SDBridgeOC is here. If your h5 partner confused about how to deal with iOS and Android. This Demo maybe help. YouTube video is here. bilibili Video is

null 20 Dec 28, 2022
Styling and coloring your XCTest logs on Xcode Console

XLTestLog Notes with Xcode 8 and XLTestLog Since Xcode 8 killed XcodeColors, the current way using XCTestLog on Xcode 8 is just plain texts with emoji

Xaree Lee 58 Feb 2, 2022
XCLog is a Swift extension that helps you print something in console when debugging your projects.

XCLog XCLog is a Swift extension that helps you print something in console when debugging your projects. Installation Open Xcode > File > Add Packages

null 1 Jan 9, 2022
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.

Please star this github repository to stay up to date. TraceLog Introduction TraceLog is a highly configurable, flexible, portable, and simple to use

Tony Stone 52 Oct 28, 2022
Simple, lightweight and flexible debug logging framework written in Swift

AELog Simple, lightweight and flexible debug logging minion written in Swift If you find yourself in upcoming statements, then you probably want to us

Marko Tadić 28 Jul 6, 2022