Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


Statistics on YALConsole

Number of watchers on Github 41
Number of open issues 0
Main language Objective-C
Average time to merge a PR less than a minute
Open pull requests 0+
Closed pull requests 0+
Last commit almost 2 years ago
Repo Created over 4 years ago
Repo Last Updated over 2 years ago
Size 2.67 MB
Homepage https://yalantis....
Organization / Authoryalantis
Contributors3
Page Updated
Do you use YALConsole? Leave a review!
View YALConsole activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating YALConsole for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Yalantis

YALConsole v1.0

YALConsole is handy and flexible logging utility that integrates into your iOS project. It may be useful to QA engineers that usually do not have access to debugger. Besides custom logging you can add counters, observers and actions.

Requirements

  • iOS 7.0 or later
  • ARC

Integration

  • Downolad YALConsole.
  • Add YALConsole.framework and YALConsole.bundle to the project.
  • Console requires FBKVOController that can be downloaded here.
  • Add -all_load flag to Other Compiler Flags in Build Settings.
  • Import header: #import "YALConsole/YALConsole.h".

Installation with CocoaPods:

Add following to your podfile:

pod 'YALConsole', :git => "https://github.com/Yalantis/YALConsole"

Usage

Console instantiates on first call. You can do that at any point of your app from any thread. After instantiation console is available by two-finger tap gesture. It consists of two tabs: Console as it is and Dashboard.

Console

Following code is similar to NSLog, it throws text message into console.

YALog(@"Hello, console!");

Unlike NSLog, output contains information about thread, class, method an line of code where call happens. Tap output cell on Console tab to see additional info.

Dashboard

There are three types of items can be placed on the Dashboard: observers, counters and actions.

Observer

Adding observer item you get ability to watch for value for key path using KVO.

[YALConsole addObserverOf:self keyPath:@"user.name" forIdentifier:@"Name"];

Identifier is mandatory for each Dashboard Item. It defines uniquity of item and allows to remove object from the Dashboard when you dont need it anymore.

Observer highlights potentially invalid values: null and nil. Click the item to see history of values of observed variable. Buttons at the bottom of the screen are Clear, Follow and Freeze. Switching Follow off allows you to scroll list even when data updates dynamically. Freezing temporarily unsubscribes list from history updates.

Counter

Counter works almost similar to observer, but incrementing is up to you. Counters values history is also available by click. Adding and incrementing Counter Item:

[YALConsole addCounterForIdentifier:@"Steps"];
[YALConsole incrementCounterForIdentifier:@"Steps"];

Action

Action Items is a button on the Dashboard that is assigned execution of specified block. This can be handy for specific actions like Keychain clearing.

[YALConsole addAction:^{NSLog(@"Bang!");} forIdentifier:@"Make some noise"];

And dont forget of retain cycles!

Call Stack Symbols

Click a value on the History screen to see call stack that led to current value assignment. You will also find threads identifier there. Tap the icon at the the bottom of the screen to copy all the info into Pasteboard.

Items removal

You can delete item by identifier:

[YALConsole removeItemForIdentifier:@"Steps"];

Or clear whole Dashboard:

[YALConsole removeAllItems];

Setup

Set the history limit with this:

[YALConsole setHistoryLimit:200];

Notice that history doesnt store values. That would make impact on apps performance or even lead to inconsistency. So history just keeps description strings. In order to avoid interference with gestures used in your application, you can set the number of taps required to show console:

[YALConsole setNumberOfTouchesRequired:3];

Contact

Follow our blog at yalantis.com

Maintainers

Aleksey Chernish

License

YALConsole is available under the MIT license. See the LICENSE file for more info.

YALConsole list of languages used
Other projects in Objective-C