Latest 0.3.0
Homepage https://github.com/kaiinui/KILogInject
License MIT
Platforms ios 7.0, requires ARC
Dependencies Aspects, KVOController
Authors

KILogInject is a set of logger utilities. It contains..

  1. Method call logger
  2. Property change logger
  3. Notification logger

Method Call Logger

NSLog() without NSLog()! It logs arguments and return value of targeted method behalf of you.

To inject the logger, do following. (You can do this anywhere.)

[KILogInject inspect:@selector(strcat:withString:) of:someObject];

Then KILogInjector will records the log for every method call.

Or inject a class?

[KILogInject inspectInstanceMethods:@selector(strcat:withString:) of:[SomeClass class]];

You can do this in anywhere. Even you can declare logger injection in your AppDelegate!

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self injectLoggers];

    return YES;
}

- (void)injectLoggers {
    ..
    [KILogInject inspectInstanceMethod:@selector(strcat:withString:) ofClass:[SomeClass class]];
    ..
}

Property Change Logger

[KILogInject properties:object];

Then when you set some properties of the object, KILogInject will records the changes like..

➠ <Book: 0x8d48770>.author = John Smith ⇦ <null>
➠ <Book: 0x8d48770>.title = Effective Cocoa ⇦ <null>
➠ <Book: 0x8d48770>.price = 20 ⇦ 0

➠ <Book: 0x8d48770>.title = Effective Cocoa 2nd edition ⇦ Effective Cocoa
➠ <Book: 0x8d48770>.price = 40 ⇦ 20

Notification Logger

[KILogInject notification:@"SomeNotificationName" from:someObject];

Will records

NSNotification<SomeNotificationName> from <SomeClass: 0x8da64d0>

Or there is shorthand for object:nil notifications.

[KILogInject notification:@"SomeNotificationName"];

Installation

pod 'KILogInject'

LICENSE

The MIT License (MIT)

Copyright (c) 2014 kaiinui

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Latest podspec

{
    "name": "KILogInject",
    "version": "0.3.0",
    "summary": "NSLog() without NSLog()! Logger injection.",
    "homepage": "https://github.com/kaiinui/KILogInject",
    "license": "MIT",
    "authors": {
        "kaiinui": "[email protected]"
    },
    "source": {
        "git": "https://github.com/kaiinui/KILogInject.git",
        "tag": "v0.3.0"
    },
    "source_files": "LogInject/Classes/**/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "Aspects": [],
        "KVOController": []
    },
    "platforms": {
        "ios": "7.0"
    }
}

Pin It on Pinterest

Share This