Skip to content

Commit

Permalink
Merge pull request #424 from rivera-ernesto/legacy_checks
Browse files Browse the repository at this point in the history
Legacy checks
  • Loading branch information
bpoplauschi committed Dec 19, 2014
2 parents 5c903db + 54c8fee commit a637aff
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Classes/CocoaLumberjack.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@

#import <Foundation/Foundation.h>

// Legacy
#ifndef DDLEGACY
#define DDLEGACY NO
// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

// Core
Expand Down
6 changes: 6 additions & 0 deletions Classes/DDASLLogCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
// prior written permission of Deusty, LLC.

#import "DDASLLogCapture.h"

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

#include <asl.h>
Expand Down
6 changes: 6 additions & 0 deletions Classes/DDASLLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
// prior written permission of Deusty, LLC.

#import <Foundation/Foundation.h>

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

/**
Expand Down
5 changes: 5 additions & 0 deletions Classes/DDAbstractDatabaseLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

/**
Expand Down
5 changes: 5 additions & 0 deletions Classes/DDFileLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

@class DDLogFileInfo;
Expand Down
7 changes: 6 additions & 1 deletion Classes/DDLegacy.h → Classes/DDLegacyMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
// prior written permission of Deusty, LLC.

/**
* Macros used for 1.9.x backwards compatibility.
* Legacy macros used for 1.9.x backwards compatibility.
*
* Imported by default when importing a DDLog.h directly and DD_LEGACY_MACROS is not defnied and set to 0.
**/

#warning CocoaLumberjack 1.9.x legacy macros enabled. \
Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h.

#ifndef LOG_LEVEL_DEF
#define LOG_LEVEL_DEF ddLogLevel
#endif
Expand Down
4 changes: 4 additions & 0 deletions Classes/DDLog+LOGV.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

Expand Down
8 changes: 6 additions & 2 deletions Classes/DDLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@

#import <Foundation/Foundation.h>

#if !defined(DDLEGACY) || DDLEGACY
#import "DDLegacy.h"
// Enable 1.9.x legacy macros if imported directly
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 1
#endif
#if DD_LEGACY_MACROS
#import "DDLegacyMacros.h"
#endif

#if OS_OBJECT_HAVE_OBJC_SUPPORT
Expand Down
5 changes: 5 additions & 0 deletions Classes/DDLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

#import <pthread.h>
Expand Down
5 changes: 5 additions & 0 deletions Classes/DDLogMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

/**
Expand Down
9 changes: 5 additions & 4 deletions Classes/DDTTYLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.

#import "DDLog.h"

#define LOG_CONTEXT_ALL INT_MAX

/**
* This class provides a logger for Terminal output or Xcode console output,
* depending on where you are running your code.
Expand All @@ -32,6 +28,11 @@
* you may choose to use only a file logger and a tty logger.
**/

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

#define LOG_CONTEXT_ALL INT_MAX
Expand Down
6 changes: 6 additions & 0 deletions Classes/Extensions/DDContextFilterLogFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
// prior written permission of Deusty, LLC.

#import <Foundation/Foundation.h>

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

/**
Expand Down
6 changes: 6 additions & 0 deletions Classes/Extensions/DDDispatchQueueLogFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

#import <Foundation/Foundation.h>
#import <libkern/OSAtomic.h>

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"


Expand Down
6 changes: 6 additions & 0 deletions Classes/Extensions/DDMultiFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
// prior written permission of Deusty, LLC.

#import <Foundation/Foundation.h>

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

#import "DDLog.h"

/**
Expand Down
8 changes: 4 additions & 4 deletions Framework/Desktop/Lumberjack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
E58078E61A01C92F008819CA /* CocoaLumberjack.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D89BA41994749300C180CF /* CocoaLumberjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
E58078E71A01C92F008819CA /* DDFileLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9C20C3192A0E0000AB7171 /* DDFileLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
E58078FC1A01C975008819CA /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BCB5C619D4BB6E0096E784 /* CocoaLumberjack.swift */; };
E58079631A032F92008819CA /* DDLegacy.h in Headers */ = {isa = PBXBuildFile; fileRef = E58079621A032F92008819CA /* DDLegacy.h */; };
E58079631A032F92008819CA /* DDLegacyMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E58079621A032F92008819CA /* DDLegacyMacros.h */; };
E5D89BA71994749300C180CF /* CocoaLumberjack.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D89BA41994749300C180CF /* CocoaLumberjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
E5D89BA81994749300C180CF /* DDAssertMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D89BA51994749300C180CF /* DDAssertMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
E5D89BA91994749300C180CF /* DDLogMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D89BA61994749300C180CF /* DDLogMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -154,7 +154,7 @@
DCB318DD14ED6C3B001CFBEE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
E58078F81A01C92F008819CA /* CocoaLumberjackSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CocoaLumberjackSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E58078F91A01C92F008819CA /* CocoaLumberjackSwift-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "CocoaLumberjackSwift-Info.plist"; path = "/Users/rivera/Documents/CyberAgent/CocoaLumberjack/Framework/Desktop/Lumberjack/CocoaLumberjackSwift-Info.plist"; sourceTree = "<absolute>"; };
E58079621A032F92008819CA /* DDLegacy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLegacy.h; sourceTree = "<group>"; };
E58079621A032F92008819CA /* DDLegacyMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLegacyMacros.h; sourceTree = "<group>"; };
E5D89BA41994749300C180CF /* CocoaLumberjack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoaLumberjack.h; sourceTree = "<group>"; };
E5D89BA51994749300C180CF /* DDAssertMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAssertMacros.h; sourceTree = "<group>"; };
E5D89BA61994749300C180CF /* DDLogMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLogMacros.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -302,7 +302,7 @@
55BCB5C619D4BB6E0096E784 /* CocoaLumberjack.swift */,
E5D89BA61994749300C180CF /* DDLogMacros.h */,
E5D89BA51994749300C180CF /* DDAssertMacros.h */,
E58079621A032F92008819CA /* DDLegacy.h */,
E58079621A032F92008819CA /* DDLegacyMacros.h */,
DA9C20C7192A0E0000AB7171 /* DDLog+LOGV.h */,
DA9C20BD192A0E0000AB7171 /* DDAbstractDatabaseLogger.h */,
DA9C20BE192A0E0000AB7171 /* DDAbstractDatabaseLogger.m */,
Expand Down Expand Up @@ -369,7 +369,7 @@
DA9C20D3192A0E0000AB7171 /* DDASLLogCapture.h in Headers */,
DA9C20E0192A0E0000AB7171 /* DDDispatchQueueLogFormatter.h in Headers */,
DA9C20DB192A0E0000AB7171 /* DDLog+LOGV.h in Headers */,
E58079631A032F92008819CA /* DDLegacy.h in Headers */,
E58079631A032F92008819CA /* DDLegacyMacros.h in Headers */,
DA9C20D1192A0E0000AB7171 /* DDAbstractDatabaseLogger.h in Headers */,
E5D89BA91994749300C180CF /* DDLogMacros.h in Headers */,
DA9C20DC192A0E0000AB7171 /* DDTTYLogger.h in Headers */,
Expand Down

0 comments on commit a637aff

Please sign in to comment.