Coder Social home page Coder Social logo

hcanzonetta / aeconsole Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tadija/aeconsole

0.0 1.0 0.0 253 KB

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

License: MIT License

Objective-C 0.71% Swift 97.84% Ruby 1.45%

aeconsole's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.