Skip to content

Commit

Permalink
Merge pull request #1224 from CocoaLumberjack/bugfix/correctly_deprec…
Browse files Browse the repository at this point in the history
…ate_tag_field

Re-introduce _tag field and deprecate it
  • Loading branch information
ffried committed Apr 9, 2021
2 parents 92986c7 + a621718 commit e518eb6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,4 @@
## [3.7.2 - Xcode 12.? on ??, 2021](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.2)
## [3.7.3 - Xcode 12.? on ??, 2021](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.3)

### Public

Expand All @@ -9,6 +9,13 @@
- _REPLACE ME_


## [3.7.2 - Xcode 12.4 on Apr 9th, 2021](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.2)

### Public

- Re-introduce (and deprecate) `_tag` field to fix breakage in 3.7.1 (#1224)


## [3.7.1 - Xcode 12.4 on Apr 7th, 2021](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.1)

### Public
Expand Down
2 changes: 1 addition & 1 deletion CocoaLumberjack.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'CocoaLumberjack'
s.version = '3.7.1'
s.version = '3.7.2'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS.'
s.homepage = 'https://github.com/CocoaLumberjack/CocoaLumberjack'
Expand Down
2 changes: 1 addition & 1 deletion Configs/Module-Shared.xcconfig
Expand Up @@ -200,7 +200,7 @@ LIBRARY_SEARCH_PATHS = $(inherited)
// Code will load on this and later versions of macOS. Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs.
MACOSX_DEPLOYMENT_TARGET = 10.10

MARKETING_VERSION = 3.7.1
MARKETING_VERSION = 3.7.2

OTHER_C_FLAGS = -Wextra

Expand Down
14 changes: 13 additions & 1 deletion Sources/CocoaLumberjack/DDLog.m
Expand Up @@ -999,6 +999,12 @@ - (instancetype)initWithMessage:(NSString *)message

_line = line;
_representedObject = tag;
#if DD_LEGACY_MESSAGE_TAG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
_tag = tag;
#pragma clang diagnostic pop
#endif
_options = options;
_timestamp = timestamp ?: [NSDate new];

Expand Down Expand Up @@ -1079,6 +1085,12 @@ - (id)copyWithZone:(NSZone * __attribute__((unused)))zone {
newMessage->_function = _function;
newMessage->_line = _line;
newMessage->_representedObject = _representedObject;
#if DD_LEGACY_MESSAGE_TAG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
newMessage->_tag = _tag;
#pragma clang diagnostic pop
#endif
newMessage->_options = _options;
newMessage->_timestamp = _timestamp;
newMessage->_threadID = _threadID;
Expand All @@ -1089,7 +1101,7 @@ - (id)copyWithZone:(NSZone * __attribute__((unused)))zone {
return newMessage;
}

// ensure compatibility even when build with DD_LEGACY_MESSAGE_TAG to 0.
// ensure compatibility even when built with DD_LEGACY_MESSAGE_TAG to 0.
- (id)tag {
return _representedObject;
}
Expand Down
3 changes: 3 additions & 0 deletions Sources/CocoaLumberjack/include/CocoaLumberjack/DDLog.h
Expand Up @@ -782,6 +782,9 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){
NSString *_fileName;
NSString *_function;
NSUInteger _line;
#if DD_LEGACY_MESSAGE_TAG
id _tag __attribute__((deprecated("Use _representedObject instead", "_representedObject")));;
#endif
id _representedObject;
DDLogMessageOptions _options;
NSDate * _timestamp;
Expand Down

0 comments on commit e518eb6

Please sign in to comment.