Skip to content

Commit

Permalink
Revert change that allowed an nil file path on the FileDestination
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveWoodCom committed Apr 5, 2017
1 parent bfa9fbf commit afbb3be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/XCGLogger/Destinations/FileDestination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ open class FileDestination: BaseQueuedDestination {
internal var appendMarker: String?

// MARK: - Life Cycle
public init(owner: XCGLogger? = nil, writeToFile: Any?, identifier: String = "", shouldAppend: Bool = false, appendMarker: String? = "-- ** ** ** --") {
public init(owner: XCGLogger? = nil, writeToFile: Any, identifier: String = "", shouldAppend: Bool = false, appendMarker: String? = "-- ** ** ** --") {
self.shouldAppend = shouldAppend
self.appendMarker = appendMarker

if writeToFile is NSString {
writeToFileURL = URL(fileURLWithPath: writeToFile as! String)
}
else if let writeToFile = writeToFile as? URL, writeToFile.isFileURL {
writeToFileURL = writeToFile
}
else {
writeToFileURL = writeToFile as? URL
writeToFileURL = nil
}

super.init(owner: owner, identifier: identifier)
Expand Down

0 comments on commit afbb3be

Please sign in to comment.