Skip to content

Commit

Permalink
Merge pull request #88 from tonystone/release-5.0.0-beta.1
Browse files Browse the repository at this point in the history
Release 5.0.0 beta.1
  • Loading branch information
tonystone authored Feb 25, 2019
2 parents da44a80 + e36e3c6 commit b5886f4
Show file tree
Hide file tree
Showing 89 changed files with 8,310 additions and 1,628 deletions.
33 changes: 15 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,40 @@ matrix:
- BUILD="swift build"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="swift build"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="pod lint"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=iOS Simulator,OS=11.3,name=iPhone 8"
- TEST_SDK=iphonesimulator
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
- TEST_SDK=iphonesimulator

-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
- TEST_SDK=iphonesimulator

-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=OS X,arch=x86_64"
Expand All @@ -75,15 +75,11 @@ before_install:
# Fix travis issue: https://github.com/travis-ci/travis-ci/issues/6307
rvm get head --auto-dotfiles || true
sudo log config --subsystem "xctest" --mode "persist:debug"
fi
#
# OSX
#
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# Fix travis issue: https://github.com/travis-ci/travis-ci/issues/6307
rvm get head --auto-dotfiles || true
sudo log config --subsystem "xctest" --mode "persist:debug"
curl -O https://swift.org/builds/swift-5.0-branch/xcode/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a-osx.pkg
sudo installer -pkg swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a-osx.pkg -target /
export TOOLCHAINS=swift
swift --version
fi
#
# Linux requires downloading Swift and tools
Expand All @@ -95,9 +91,9 @@ before_install:
sudo apt-get update -y
sudo apt-get -y install clang-3.8 lldb-3.8 libicu-dev
wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz
tar xzvf swift-4.1-RELEASE-ubuntu14.04.tar.gz
export PATH=$(pwd)/swift-4.1-RELEASE-ubuntu14.04/usr/bin:$PATH
wget https://swift.org/builds/swift-5.0-branch/ubuntu1404/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a-ubuntu14.04.tar.gz
tar xzvf swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a-ubuntu14.04.tar.gz
export PATH=$(pwd)/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a-ubuntu14.04/usr/bin:$PATH
fi
script:
Expand All @@ -108,6 +104,7 @@ script:
- |
if [[ "$BUILD" == "pod lint" ]]; then
set -e # Fail (and stop build) on first non zero exit code
# Currently we can't build using swift 5 under cocoapods.
bundler exec pod lib lint
set +e
fi
Expand Down
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# Change Log
All significant changes to this project will be documented in this file.

## 4.x.x (Upcoming release)
## [5.0.0-beta.1] (https://github.com/tonystone/tracelog/tree/5.0.0-beta.1)

#### Added
- Added `OutputStreamFormatter` protocol to define formatters for use with byte output stream type Writers.
- Added `TextFormat`, an implementation of a OutputStreamFormatter that formats its output based on a supplied template (this is the default formatter for Console and File output).
- Added `JSONFormat`, an implementation of a OutputStreamFormatter that formats its output in standard JSON format.
- Added `OutputStreamWriter` protocol to define types that write byte streams to their output and accept `OutputStreamFormatter` types to format the output.
- Added `LogEntry` tuple type to `Writer` defining the formal types that a Writer writes.
- Added `.buffer` option for `.async` concurrency modes to allow for buffering when the writer is not available to write to its endpoint.

#### Changed
- Requires Swift 5 for compilation.
- Changed parameters to `.async` to include options for configuration of the mode (`.async(options: Set<AsyncOption>)` and `.async(Writer, options: Set<AsyncOption>)`).
- Changed `Writer` protocol `log()` method to `write(_ entry: Writer.LogEntry)` to make it easier to process messages by writers and formatters.
- Changed `Writer` return to `Swift.Result<Int, FailedReason>` to return instructions for TraceLog for buffering and error recovery.
- Changed `ConsoleWriter` to accept new `OutputStreamFormatter` instances allowing you to customize the output log format (default is `TextFormat`.)
- Changed `FileWriter` public interface
* `FileWriter` now requires the log directory be passed in, removing default value of `./`.
* Removed the `fileConfiguration` parameter replacing with new `strategy` enum.
* It now accepts the new `OutputStreamFormatter` instances allowing you to customize the output log format (default is `TextFormat`.)
- Changed `FileWriter` archive file name date format to "yyyyMMdd-HHmm-ss-SSS" (This was done for maximum compatibility between platforms and can be overridden in the FileConfiguration object passed at init.)

#### Removed
- Removed `TraceLogTestHarness` module.

#### Fixed
- Fixed `logTrace` when no trace level is passed. It's now the correct default value of 1 instead of 4 (issue #58).
Expand Down Expand Up @@ -66,7 +89,7 @@ Released on 2016-10-16.

#### Updated
- Inline documentation for all public classes and functions.
- Combined TraceLog.configure func's into one with the same symantics as the 3 previous funcs.
- Combined TraceLog.configure func's into one with the same semantics as the 3 previous funcs.
- iOS example application converting it to Swift.

#### Fixed
Expand Down
26 changes: 0 additions & 26 deletions Docs/LoggerProxy.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source 'https://rubygems.org'
gem 'cocoapods', '~> 1.5.1'
gem 'cocoapods', '1.6.0'
16 changes: 7 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:5.0
///
/// Package.swift
///
Expand All @@ -24,23 +24,21 @@ let package = Package(
name: "TraceLog",
targets: [
/// Module targets
.target(name: "TraceLog", dependencies: [], path: "Sources/TraceLog"),
.target(name: "TraceLogTestHarness", dependencies: ["TraceLog"], path: "Sources/TraceLogTestHarness"),
.target(name: "TraceLog", dependencies: [], path: "Sources/TraceLog"),

/// Tests
.testTarget(name: "TraceLogTests", dependencies: ["TraceLog", "TraceLogTestHarness"], path: "Tests/TraceLogTests"),
.testTarget(name: "TraceLogTestHarnessTests", dependencies: ["TraceLog", "TraceLogTestHarness"], path: "Tests/TraceLogTestHarnessTests")
.testTarget(name: "TraceLogTests", dependencies: ["TraceLog"], path: "Tests/TraceLogTests")
],
swiftLanguageVersions: [4]
swiftLanguageVersions: [.v4_2]
)

var productTargets = ["TraceLog", "TraceLogTestHarness"]
var productTargets = ["TraceLog"]

///
/// These platforms can also support Objective-C so we create a module for it.
///
#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS)
package.targets.append(.target(name: "TraceLogObjC", dependencies: ["TraceLog"], path: "Sources/TraceLogObjC"))
#if canImport(ObjectiveC)
package.targets.append( .target(name: "TraceLogObjC", dependencies: ["TraceLog"], path: "Sources/TraceLogObjC"))
package.targets.append(.testTarget(name: "TraceLogObjCTests", dependencies: ["TraceLogObjC"], path: "Tests/TraceLogObjCTests"))

productTargets.append("TraceLogObjC")
Expand Down
2 changes: 1 addition & 1 deletion Package.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
CLANG_ENABLE_MODULES = YES

IPHONEOS_DEPLOYMENT_TARGET = 9.0
MACOSX_DEPLOYMENT_TARGET = 10.10
MACOSX_DEPLOYMENT_TARGET = 10.13
TVOS_DEPLOYMENT_TARGET = 9.0
WATCHOS_DEPLOYMENT_TARGET = 2.0
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms: iOS | macOS | watchOS | tvOS | Linux" />
</a>
<a href="https://github.com/tonystone/tracelog/" target="_blank">
<img src="https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat" alt="Swift 4.1"/>
<img src="https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat" alt="Swift 5.0"/>
</a>
<a href="http://cocoadocs.org/docsets/TraceLog" target="_blank">
<img src="https://img.shields.io/cocoapods/v/TraceLog.svg?style=flat" alt="Version"/>
Expand Down Expand Up @@ -38,15 +38,19 @@ TraceLog's is designed to be a universal, flexible, portable, lightweight, and e
- [x] **Logging Levels** (error, warning, info, trace1, trace2, trace3, trace4).
- [x] Custom **tag** support for message grouping and filtering.
- [x] Dynamically configurable levels via the OS environment at run time or inline code compiled into the application.
- [x] Installable Log Writers (multiple writers at a time)
- [x] Create custom Log writers for any use-case.
- [x] Installable log writers (multiple writers at a time)
- [x] Create custom log writers for any use-case.
- [x] Predefined log writers to write to various endpoints.
* Built-in
* Built-in (`OutputStreamWriter`s)
* **Stdout (ConsoleWriter)** - A simple standard out (stdout) writer for logging to the console or terminal.
* **File (FileWriter)** - A file writer which writes log output to files on local disk managing rotation and archive of files as needed.
* External
* **Apple Unified Logging (AdaptiveWriter)** - On Apple platforms the AdaptiveWriter writes to the Unified Logging System (see [https://github.com/tonystone/tracelog-adaptive-writer](https://github.com/tonystone/tracelog-adaptive-writer)).
* **Linux systemd Journal (AdaptiveWriter)** - On Linux platforms the AdaptiveWriter writes to the systemd journal (see [https://github.com/tonystone/tracelog-adaptive-writer](https://github.com/tonystone/tracelog-adaptive-writer))
- [x] Output formatters for formatting the log entries in any format required.
* **TextFormat** a customizable human readable text formatter useable with any `OutputStreamWriter`.
* **JSONFormat** a customizable JSON string formatter usable with any `OutputStreamWriter`.
- [x] Create custom output formatters for any use case.
- [x] Multiple **concurrency modes** for writing to Writers. Settable globally or per Writer installed.
* **direct** - straight through real-time logging.
* **sync** - blocking queued logging.
Expand Down Expand Up @@ -323,16 +327,16 @@ For XCode `TRACELOG_DISABLED` can be set in the project target. For **Swift Pack

Build Environment

| Platform | Swift | Swift Build | Xcode |
|:--------:|:-----:|:----------:|:------:|
| Linux | 4.1 | &#x2714; | &#x2718; |
| OSX | 4.1 | &#x2714; | Xcode 9.3 |
| Platform | Version | Swift | Swift Build | Xcode |
|:--------:|:--------------------------:|:-----:|:-----------:|:--------:|
| Linux | Ubuntu 14.04, 16.04, 16.10 | 5.0 | &#x2714; | &#x2718; |
| OSX | 10.13 | 5.0 | &#x2714; | Xcode 10 |

Minimum Runtime Version

| iOS | OS X | tvOS | watchOS | Linux |
|:---:|:-----:|:----:|:-------:|:------------:|
| 9.0 | 10.10 | 9.0 | 2.0 | Ubuntu 14.04, 16.04, 16.10 |
| iOS | OS X | tvOS | watchOS | Linux |
|:---:|:-----:|:----:|:-------:|:--------------------------:|
| 9.0 | 10.13 | 9.0 | 2.0 | Ubuntu 14.04, 16.04, 16.10 |

> **Note:**
>
Expand Down
Loading

0 comments on commit b5886f4

Please sign in to comment.