dannys42 / DSLogs

Some simple iOS Logging functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSLogs

CI Status Version License Platform

Description

DSLogs provides a very simple set of macros that wrap around NSLog().

When releasing apps to the App Store, it's usually good to disable NSLog(). These macros provide a simple way to manage this.

Usage

Code Console Output
DLog(@"Message"); FILE:LineNum Message
WLog(@"Message"); FILE:LineNum WARNING: Message
ELog(@"Message"); FILE:LineNum ERROR: Message

When ENABLE_LOGS is not specified, DLog() resolves to a no-op.

Requirements

Installation

DSLogs is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DSLogs"

To enable DLog(), you will need to add some compile-time settings. Go to your project build settings.

For Objective-C, under Custom Compiler Flags, add the following to Other C Flags: Debug: -DENABLE_LOGS=1 Release: -DENABLE_LOGS=0

For Swift, under Custom Flags, add the following to your Active Compilation Conditoins: Debug: ENABLE_LOGS

Note that for swift

For Objective-C, you should add the following to a common header file:

#import <DSLogs.h>

For Swift, you will need to add the following where you expect to use DSLogs:

import DSLogs

Author

Danny Sung, danny@dannysung.com

License

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

Bitdeli Badge

About

Some simple iOS Logging functions

License:MIT License


Languages

Language:Objective-C 73.0%Language:Ruby 14.0%Language:Swift 11.5%Language:C 1.5%