Skip to content

Instantly share code, notes, and snippets.

@ThinhPhan
Created April 8, 2015 07:59
Show Gist options
  • Save ThinhPhan/09f4f59b83c7b092fa40 to your computer and use it in GitHub Desktop.
Save ThinhPhan/09f4f59b83c7b092fa40 to your computer and use it in GitHub Desktop.
Xcode Project-prefix Debug Log
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#endif
// Always show log regardless DEBUG flag
#define ALog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
// Show debug log without date time
#if DEBUG
#define DLog(format, ...) CFShow((__bridge CFStringRef)[NSString stringWithFormat:@"%s [#%d] : %@", __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:(format), ## __VA_ARGS__]]);
#else
#define DLog(...)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment