Automate box any value! Print log without any format control symbol! Change debug habit thoroughly!

Related tags

Logging LxDBAnything
Overview

LxDBAnything

Automate box any value! Print log without any format control symbol! Change debug habit thoroughly! 

Installation

You only need drag LxDBAnything.h to your project.

Podfile

pod 'LxDBAnything', '~> 1.1.1'

Support

Minimum support iOS version: iOS 6.0

Usage

    #import "LxDBAnything.h"

    id obj = self.view;
    LxDBAnyVar(obj);

    CGPoint point = CGPointMake(12.34, 56.78);
    LxDBAnyVar(point);

    CGSize size = CGSizeMake(87.6, 5.43);
    LxDBAnyVar(size);

    CGRect rect = CGRectMake(2.3, 4.5, 5.6, 7.8);
    LxDBAnyVar(rect);

    NSRange range = NSMakeRange(3, 56);
    LxDBAnyVar(range);

    CGAffineTransform affineTransform = CGAffineTransformMake(1, 2, 3, 4, 5, 6);
    LxDBAnyVar(affineTransform);

    UIEdgeInsets edgeInsets = UIEdgeInsetsMake(3, 4, 5, 6);
    LxDBAnyVar(edgeInsets);

    SEL sel = @selector(viewDidLoad);
    LxDBAnyVar(sel);

    Class class = [UIBarButtonItem class];
    LxDBAnyVar(class);

    NSInteger i = 231;
    LxDBAnyVar(i);

    CGFloat f = M_E;
    LxDBAnyVar(f);

    BOOL b = YES;
    LxDBAnyVar(b);

    char c = 'S';
    LxDBAnyVar(c);

    CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
    LxDBAnyVar(colorSpaceRef);

    //  ......

    LxPrintAnything(You can use macro LxPrintAnything() print any without quotation as you want!);

    LxPrintf(@"Print format string you customed: %@", LxBox(affineTransform));

    NSLog(@"Even use general NSLog function to print: %@", LxBox(edgeInsets));

    LxPrintf(@"The type of obj is %@", LxTypeStringOfVar(obj));
    LxPrintf(@"The type of point is %@", LxTypeStringOfVar(point));
    LxPrintf(@"The type of size is %@", LxTypeStringOfVar(size));
    LxPrintf(@"The type of rect is %@", LxTypeStringOfVar(rect));
    LxPrintf(@"The type of range is %@", LxTypeStringOfVar(range));
    LxPrintf(@"The type of affineTransform is %@", LxTypeStringOfVar(affineTransform));
    LxPrintf(@"The type of edgeInsets is %@", LxTypeStringOfVar(edgeInsets));
    LxPrintf(@"The type of class is %@", LxTypeStringOfVar(class));
    LxPrintf(@"The type of i is %@", LxTypeStringOfVar(i));
    LxPrintf(@"The type of f is %@", LxTypeStringOfVar(f));
    LxPrintf(@"The type of b is %@", LxTypeStringOfVar(b));
    LxPrintf(@"The type of c is %@", LxTypeStringOfVar(c));
    LxPrintf(@"The type of colorSpaceRef is %@", LxTypeStringOfVar(colorSpaceRef));

    //  ......

    TestModel * testModel = [[TestModel alloc]init];
    testModel.array = @[@1, @"fewfwe", @{@21423.654:@[@"fgewgweg", [UIView new]]}, @YES];
    testModel.dictionary = @{@YES:@[[UITableViewCell new], @"fgewgweg", @-543.64]};
    testModel.set = [NSSet setWithObjects:@NO, @4.325, @{@"fgewgweg":[UIView new]}, nil];
    testModel.orderSet = [NSOrderedSet orderedSetWithObjects:@{@21423.654:@[@"fgewgweg", [UIView new]]}, @1, @"fewfwe", @YES, nil];

    LxDBObjectAsJson(testModel);
    LxDBObjectAsXml(testModel);
    
    LxDBViewHierarchy(self.view.window);

    // Run your application and you'll see:

    ๐Ÿ“-[ViewController viewDidLoad] + 24๐ŸŽˆ obj = <UIView: 0x7ff8ba711fb0; frame = (0 0; 414 736); autoresize = W+H; layer = <CALayer: 0x7ff8ba710da0>>
    ๐Ÿ“-[ViewController viewDidLoad] + 27๐ŸŽˆ point = NSPoint: {12.34, 56.780000000000001}
    ๐Ÿ“-[ViewController viewDidLoad] + 30๐ŸŽˆ size = NSSize: {87.599999999999994, 5.4299999999999997}
    ๐Ÿ“-[ViewController viewDidLoad] + 33๐ŸŽˆ rect = NSRect: {{2.2999999999999998, 4.5}, {5.5999999999999996, 7.7999999999999998}}
    ๐Ÿ“-[ViewController viewDidLoad] + 36๐ŸŽˆ range = NSRange: {3, 56}
    ๐Ÿ“-[ViewController viewDidLoad] + 39๐ŸŽˆ affineTransform = CGAffineTransform: {{1, 2, 3, 4}, {5, 6}}
    ๐Ÿ“-[ViewController viewDidLoad] + 42๐ŸŽˆ edgeInsets = UIEdgeInsets: {3, 4, 5, 6}
    ๐Ÿ“-[ViewController viewDidLoad] + 45๐ŸŽˆ sel = viewDidLoad
    ๐Ÿ“-[ViewController viewDidLoad] + 48๐ŸŽˆ class = UIBarButtonItem
    ๐Ÿ“-[ViewController viewDidLoad] + 51๐ŸŽˆ i = 231
    ๐Ÿ“-[ViewController viewDidLoad] + 54๐ŸŽˆ f = 2.718281828459045
    ๐Ÿ“-[ViewController viewDidLoad] + 57๐ŸŽˆ b = YES
    ๐Ÿ“-[ViewController viewDidLoad] + 60๐ŸŽˆ c = S
    ๐Ÿ“-[ViewController viewDidLoad] + 63๐ŸŽˆ colorSpaceRef = 0x7ff8ba706da0
    ๐Ÿ“-[ViewController viewDidLoad] + 67๐ŸŽˆ You can use macro LxPrintAnything() print any without quotation as you want!
    ๐Ÿ“-[ViewController viewDidLoad] + 69๐ŸŽˆ Print format string you customed: CGAffineTransform: {{1, 2, 3, 4}, {5, 6}}
    2015-11-23 15:40:25.639 LxDBAnythingDemo[12699:198689] Even use normal NSLog function to print: UIEdgeInsets: {3, 4, 5, 6}
    ๐Ÿ“-[ViewController viewDidLoad] + 73๐ŸŽˆ The type of obj is UIView
    ๐Ÿ“-[ViewController viewDidLoad] + 74๐ŸŽˆ The type of point is CGPoint
    ๐Ÿ“-[ViewController viewDidLoad] + 75๐ŸŽˆ The type of size is CGSize
    ๐Ÿ“-[ViewController viewDidLoad] + 76๐ŸŽˆ The type of rect is CGRect
    ๐Ÿ“-[ViewController viewDidLoad] + 77๐ŸŽˆ The type of range is NSRange
    ๐Ÿ“-[ViewController viewDidLoad] + 78๐ŸŽˆ The type of affineTransform is CGAffineTransform
    ๐Ÿ“-[ViewController viewDidLoad] + 79๐ŸŽˆ The type of edgeInsets is LxEdgeInsets
    ๐Ÿ“-[ViewController viewDidLoad] + 80๐ŸŽˆ The type of class is Class
    ๐Ÿ“-[ViewController viewDidLoad] + 81๐ŸŽˆ The type of i is long
    ๐Ÿ“-[ViewController viewDidLoad] + 82๐ŸŽˆ The type of f is double
    ๐Ÿ“-[ViewController viewDidLoad] + 83๐ŸŽˆ The type of b is BOOL
    ๐Ÿ“-[ViewController viewDidLoad] + 84๐ŸŽˆ The type of c is char
    ๐Ÿ“-[ViewController viewDidLoad] + 85๐ŸŽˆ The type of colorSpaceRef is pointer
    ๐Ÿ“-[ViewController viewDidLoad] + 95๐ŸŽˆ <TestModel: 0x7ff8ba7113a0> = {
        "affineTransform" : "CGAffineTransform: {{0, 0, 0, 0}, {0, 0}}",
        "orderSet" : [
            {
                "21423.654" : [
                    "fgewgweg",
                    "<UIView: 0x7ff8ba713fc0; frame = (0 0; 0 0); layer = <CALayer: 0x7ff8ba714130>>"
                ]
            },
            "1",
            "fewfwe"
        ],
        "dictionary" : {
            "1" : [
                "<UITableViewCell: 0x7ff8ba7117e0; frame = (0 0; 320 44); layer = <CALayer: 0x7ff8ba711d20>>",
                "fgewgweg",
                "-543.64"
            ]
        },
        "flt" : "0",
        "chr" : "0",
        "size" : "NSSize: {0, 0}",
        "edgeInsets" : "UIEdgeInsets: {0, 0, 0, 0}",
        "set" : [
            "0",
            "4.325",
            {
                "fgewgweg" : "<UIView: 0x7ff8ba713d10; frame = (0 0; 0 0); layer = <CALayer: 0x7ff8ba713e80>>"
            }
        ],
        "bl" : "0",
        "point" : "NSPoint: {0, 0}",
        "array" : [
            "1",
            "fewfwe",
            {
                "21423.654" : [
                    "fgewgweg",
                    "<UIView: 0x7ff8ba7114e0; frame = (0 0; 0 0); layer = <CALayer: 0x7ff8ba70c680>>"
                ]
            },
            "1"
        ],
        "range" : "NSRange: {0, 0}",
        "integer" : "0",
        "rect" : "NSRect: {{0, 0}, {0, 0}}"
    }
    ๐Ÿ“-[ViewController viewDidLoad] + 96๐ŸŽˆ <TestModel: 0x7ff8ba7113a0> = <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>affineTransform</key>
        <string>CGAffineTransform: {{0, 0, 0, 0}, {0, 0}}</string>
        <key>array</key>
        <array>
            <string>1</string>
            <string>fewfwe</string>
            <dict>
                <key>21423.654</key>
                <array>
                    <string>fgewgweg</string>
                    <string>&lt;UIView: 0x7ff8ba7114e0; frame = (0 0; 0 0); layer = &lt;CALayer: 0x7ff8ba70c680&gt;&gt;</string>
                </array>
            </dict>
            <string>1</string>
        </array>
        <key>bl</key>
        <string>0</string>
        <key>chr</key>
        <string>0</string>
        <key>dictionary</key>
        <dict>
            <key>1</key>
            <array>
                <string>&lt;UITableViewCell: 0x7ff8ba7117e0; frame = (0 0; 320 44); layer = &lt;CALayer: 0x7ff8ba711d20&gt;&gt;</string>
                <string>fgewgweg</string>
                <string>-543.64</string>
            </array>
        </dict>
        <key>edgeInsets</key>
        <string>UIEdgeInsets: {0, 0, 0, 0}</string>
        <key>flt</key>
        <string>0</string>
        <key>integer</key>
        <string>0</string>
        <key>orderSet</key>
        <array>
            <dict>
                <key>21423.654</key>
                <array>
                    <string>fgewgweg</string>
                    <string>&lt;UIView: 0x7ff8ba713fc0; frame = (0 0; 0 0); layer = &lt;CALayer: 0x7ff8ba714130&gt;&gt;</string>
                </array>
            </dict>
            <string>1</string>
            <string>fewfwe</string>
        </array>
        <key>point</key>
        <string>NSPoint: {0, 0}</string>
        <key>range</key>
        <string>NSRange: {0, 0}</string>
        <key>rect</key>
        <string>NSRect: {{0, 0}, {0, 0}}</string>
        <key>set</key>
        <array>
            <string>0</string>
            <string>4.325</string>
            <dict>
                <key>fgewgweg</key>
                <string>&lt;UIView: 0x7ff8ba713d10; frame = (0 0; 0 0); layer = &lt;CALayer: 0x7ff8ba713e80&gt;&gt;</string>
            </dict>
        </array>
        <key>size</key>
        <string>NSSize: {0, 0}</string>
    </dict>
    </plist>

    ๐Ÿ“-[ViewController viewDidAppear:] + 103๐ŸŽˆself.view.window =
    0๏ผƒ <UIWindow: 0x7ff8ba4306c0; frame = (0 0; 414 736); autoresize = W+H; gestureRecognizers = <NSArray: 0x7ff8ba431830>; layer = <UIWindowLayer: 0x7ff8ba42cd00>>
    1๏ผƒ     <UIView: 0x7ff8ba711fb0; frame = (0 0; 414 736); autoresize = W+H; layer = <CALayer: 0x7ff8ba710da0>>
    2๏ผƒ         <_UILayoutGuide: 0x7ff8ba712380; frame = (0 0; 0 20); hidden = YES; layer = <CALayer: 0x7ff8ba70c660>>
    2๏ผƒ         <_UILayoutGuide: 0x7ff8ba534d40; frame = (0 736; 0 0); hidden = YES; layer = <CALayer: 0x7ff8ba534ec0>>

    //  Different debug log experience!

License

LxDBAnything is available under the MIT License. See the LICENSE file for more info.
You might also like...
๐Ÿฏ 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

A Swift-based API for reading from & writing to the Apple System Log (more commonly known somewhat inaccurately as
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

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

Log messages to text files and share them by email or other way.
Log messages to text files and share them by email or other way.

LogToFiles How to log messages to text files and share them by email or share center. 1 - Add the Log.swift file to your App 2 - Just log the messages

Simply, Logify provides instant colorful logs to improve log tracking and bug tracing
Simply, Logify provides instant colorful logs to improve log tracking and bug tracing

Logify Simply, Logify provides instant colorful logs to improve log tracking and bug tracing. Why I need to use Logify? As discussed before in a lot o

Comments
  • ๆ–ฐๅปบ็š„ๅทฅ็จ‹ ๏ผŒ็›ดๆŽฅpodๆˆ–่€…ๆ‹–ๅ…ฅ้กน็›ฎๆŠฅ้”™ใ€‚

    ๆ–ฐๅปบ็š„ๅทฅ็จ‹ ๏ผŒ็›ดๆŽฅpodๆˆ–่€…ๆ‹–ๅ…ฅ้กน็›ฎๆŠฅ้”™ใ€‚

    ๆ–ฐๅปบ็š„ๅทฅ็จ‹ ๏ผŒ็›ดๆŽฅpodๆˆ–่€…ๆ‹–ๅ…ฅ้กน็›ฎๆŠฅ้”™ใ€‚ ไฝฟ็”จ็š„ๆ—ถๅ€™ ๆŠฅC99้”™่ฏฏใ€‚ hๆ–‡ไปถ๏ผŒๆˆ‘่‚ฏๅฎšไธ็”จๅŠ ๅ…ฅๅคดๆ–‡ไปถ็š„๏ผŒ ๅฏ็คบๆˆ‘่ฏ•่ฟ‡ๅŠ ๅคดๆ–‡ไปถ๏ผŒ ไผšๆŠฅ้”™ใ€‚

    ็›ดๆŽฅ่ฐƒ็”จ LxDBAnyVar(xx); ไผšๆŠฅ้”™ใ€‚ Implicit declaration of function 'LxDBAnyVar' is invalid in C99 ๅพฎๅšไธ็†ๆˆ‘๏ผŒQ็พคไธ็†ๆˆ‘๏ผŒ ่ฟ™้‡Œๅ†ไธ็†ๆˆ‘๏ผŒๆˆ‘ๅฐฑๅฏไปฅๆ”พๅผƒไบ†= =

    opened by yimouleng 3
  • ่‡ชๅฎšไน‰็š„Modelๅฏไปฅๆ‰“ๅฐไนˆ

    ่‡ชๅฎšไน‰็š„Modelๅฏไปฅๆ‰“ๅฐไนˆ

    ๆฏ”ๅฆ‚ๆœ‰ไธชModel @interface UserInfo : NSObject @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *age; @end

    UserInfo *user; Log(user)ๆ‰“ๅฐๅ‡บๆฏไธชๅฑžๆ€ง็š„ๅ€ผ๏ผŒๅฏไปฅๅ—๏ผŸ่ฐข่ฐข๏ผ

    opened by wtuyp 2
Owner
DeveloperLx
่™”่™”ไปฅๅพ…๏ผŒๆณๆณไบŽๅฟƒ
DeveloperLx
Customizable Console UI overlay with debug log on top of your iOS App

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 fi

Marko Tadiฤ‡ 142 Dec 21, 2022
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 lightweight Swift logger, uses `print` in development and `NSLog` in production. Support colourful and formatted output.

Loggerithm A lightweight Swift logger, uses print in Debug and NSLog in Production with colourful output. Why In Swift, we usually use print to log in

HongHao Zhang 270 Oct 8, 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
LogDog is designed to work out of the box, you can use the pre-configured logger anytime, anywhere

LogDog user-friendly logging apple/swift-log api compatible Usage LogDog is designed to work out of the box, you can use the pre-configured logger any

Luo Xiu 21 Aug 14, 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
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

Chime 2 Apr 12, 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