Skip to content

Commit

Permalink
Version bump 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveWoodCom committed Aug 21, 2016
1 parent 120976e commit da3699e
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 37 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ in your repository folder.

Add the following line to your `Cartfile`.

```github "DaveWoodCom/XCGLogger" ~> 3.3```
```github "DaveWoodCom/XCGLogger" ~> 3.4```

Then run `carthage update --no-use-binaries` or just `carthage update`. For details of the installation and usage of Carthage, visit [it's project page](https://github.com/Carthage/Carthage).

Expand All @@ -65,15 +65,15 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'XCGLogger', '~> 3.3'
pod 'XCGLogger', '~> 3.4'
```

Then run `pod install`. For details of the installation and usage of CocoaPods, visit [it's official web site](https://cocoapods.org/).

###Backwards Compatibility

Use:
* XCGLogger version 3.3 for Swift 2.2
* XCGLogger version 3.4 for Swift 2.2
* XCGLogger version 3.2 for Swift 2.0-2.1
* XCGLogger version 2.x for Swift 1.2
* XCGLogger version 1.x for Swift 1.1 and below.
Expand Down Expand Up @@ -127,9 +127,9 @@ log.severe("A severe error occurred, we are likely about to crash now")

The different methods set the log level of the message. XCGLogger will only print messages with a log level that is >= its current log level setting.

##Advanced Usage
##Advanced Usage (Recommended)

XCGLogger aims to be simple to use and get you up and running quickly with as few as 2 lines of code above. But it's allows for much greater control and flexibility. Here's an example of configuring the logger to output to the Apple System Log as well as a file.
XCGLogger aims to be simple to use and get you up and running quickly with as few as 2 lines of code above. But it allows for much greater control and flexibility. Here's an example of configuring the logger to output to the Apple System Log as well as a file.

```Swift
// Create a logger object with no destinations
Expand Down Expand Up @@ -287,6 +287,24 @@ This works extremely well when combined with the Alternate Configurations method
#endif
```

#####Append To Existing Log File

When using the advanced configuration of the logger (see Advanced Usage above), you can now specify that the logger append to an existing log file, instead of automatically overwriting it.

Add the optional `shouldAppend:` parameter when initializing the `XCGFileLogDestination` object. You can also add the `appendMarker:` parameter to add a marker to the log file indicating where a new instance of your app started appending. By default we'll add `-- ** ** ** --` if the parameter is omitted. Set it to `nil` to skip appending the marker.

```let fileLogDestination = XCGFileLogDestination(owner: log, writeToFile: "/path/to/file", identifier: "advancedLogger.fileLogDestination", shouldAppend: true, appendMarker: "-- Relauched App --")```


#####Log File Rotation

When logging to a file, you have the option to rotate the log file to an archived destination, and have the logger automatically create a new log file in place of the old one.

Using the `XCGFileLogDestination` object in your logger call the `rotateFile(archiveToFile:)` method. Pass either a path or file URL to a location you'd like to store the old file. The method will return `true` on success, after which you can do whatever you need with the old file, compress it, email it, etc.

**Hint**: see the `logDestination(identifier:)` method on XCGLogger, to get your current `XCGFileLogDestination` object, or save a reference to it when you create it using the advanced usage options above.


##Third Party Tools That Work With XCGLogger

[**XcodeColors:**](https://github.com/robbiehanson/XcodeColors) Enable colour in the Xcode console
Expand All @@ -302,7 +320,6 @@ This works extremely well when combined with the Alternate Configurations method
- Add more examples of some advanced use cases
- Add additional log destination types
- Add Objective-C support
- Add log file rotation options
- Add Swift Package Manager support
- Add Linux support

Expand All @@ -321,6 +338,7 @@ TV Tune Up: https://www.cerebralgardens.com/tvtuneup

###Change Log

* **Version 3.4**: *(2016/08/21)* - Finally added an option to append to an existing log file, and added a basic log rotation method. Other bug fixes. This will likely be the last version for Swift 2.x.
* **Version 3.3**: *(2016/03/27)* - Updated for Xcode 7.3 (Swift 2.2). If you're still using 7.2 (Swift 2.1), you must use XCGLogger 3.2.
* **Version 3.2**: *(2016/01/04)* - Added option to omit the default destination (for advanced usage), added background logging option
* **Version 3.1.1**: *(2015/11/18)* - Minor clean up, fixes an app submission issue for tvOS
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "XCGLogger"
s.version = "3.3"
s.version = "3.4"
s.summary = "A debug log module for use in Swift projects."

s.description = <<-DESC
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/DaveWoodX"
s.platforms = { :ios => "7.0", :watchos => "2.0", :tvos => "9.0" }

s.source = { :git => "https://github.com/DaveWoodCom/XCGLogger.git", :tag => "Version_3.3" }
s.source = { :git => "https://github.com/DaveWoodCom/XCGLogger.git", :tag => "Version_3.4" }
s.source_files = "XCGLogger/Library/XCGLogger/XCGLogger.swift"

s.ios.deployment_target = '8.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -463,7 +463,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/OSX/OSXDemo/OSXDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>7</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/OSX/OSXDemo/OSXDemoTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>7</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -699,7 +699,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/iOS/iOSDemo/iOSDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>7</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/iOS/iOSDemo/iOSDemoTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>7</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>7</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/iOS/iOSDemo/watchOSDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>7</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -438,7 +438,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/tvOS/tvOSDemo/tvOSDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>7</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down
4 changes: 2 additions & 2 deletions XCGLogger/DemoApps/tvOS/tvOSDemo/tvOSDemoTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>7</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions XCGLogger/Library/XCGLogger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -676,7 +676,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 3.3;
CURRENT_PROJECT_VERSION = 3.4;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down
2 changes: 1 addition & 1 deletion XCGLogger/Library/XCGLogger/OSX/Info-OSX.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion XCGLogger/Library/XCGLogger/XCGLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public class XCGLogger: CustomDebugStringConvertible {
public static let baseFileLogDestinationIdentifier = "com.cerebralgardens.xcglogger.logdestination.file"
public static let logQueueIdentifier = "com.cerebralgardens.xcglogger.queue"
public static let nsdataFormatterCacheIdentifier = "com.cerebralgardens.xcglogger.nsdataFormatterCache"
public static let versionString = "3.3"
public static let versionString = "3.4"
}
public typealias constants = Constants // Preserve backwards compatibility: Constants should be capitalized since it's a type

Expand Down
2 changes: 1 addition & 1 deletion XCGLogger/Library/XCGLogger/iOS/Info-iOS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion XCGLogger/Library/XCGLogger/tvOS/Info-tvOS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion XCGLogger/Library/XCGLoggerTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>3.3</string>
<string>3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit da3699e

Please sign in to comment.