Skip to content

Commit 58c3377

Browse files
author
Kohki Miki
authored
Merge pull request #26 from cookpad/buffered-output
BufferedOutput must be InstantiatableOutput
2 parents bb0b14b + fb8523f commit 58c3377

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/Puree/Output/BufferedOutput.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Foundation
22

3-
open class BufferedOutput: Output {
3+
open class BufferedOutput: InstantiatableOutput {
44
private let dateProvider: DateProvider = DefaultDateProvider()
55
internal let readWriteQueue = DispatchQueue(label: "com.cookpad.Puree.Logger.BufferedOutput", qos: .background)
66

7-
public init(logStore: LogStore, tagPattern: TagPattern) {
7+
required public init(logStore: LogStore, tagPattern: TagPattern, options: OutputOptions? = nil) {
88
self.logStore = logStore
99
self.tagPattern = tagPattern
1010
}

Tests/PureeTests/LoggerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class LoggerTests: XCTestCase {
5757
XCTAssertEqual(buffer.logs(for: "pv").count, 1)
5858

5959
let log = buffer.logs(for: "pv").first!
60-
guard let userInfo = try? JSONSerialization.jsonObject(with: log.userData!, options: []) as! [String: Any] else {
60+
guard let userInfo = try? (JSONSerialization.jsonObject(with: log.userData!, options: []) as! [String: Any]) else {
6161
return XCTFail("userInfo could not decoded")
6262
}
6363
XCTAssertEqual(userInfo["page_name"] as! String, "Top")
@@ -191,7 +191,7 @@ class LoggerTests: XCTestCase {
191191

192192
for index in testIndices {
193193
let found = logs.contains { log -> Bool in
194-
guard let userInfo = try? JSONSerialization.jsonObject(with: log.userData!, options: []) as! [String: Any] else {
194+
guard let userInfo = try? JSONSerialization.jsonObject(with: log.userData!, options: []) as? [String: Any] else {
195195
XCTFail("userInfo could not decoded")
196196
return false
197197
}

0 commit comments

Comments
 (0)