diff --git a/Sources/SLLog/SLLogFile.swift b/Sources/SLLog/SLLogFile.swift index 7dc4a6c..d40ca20 100644 --- a/Sources/SLLog/SLLogFile.swift +++ b/Sources/SLLog/SLLogFile.swift @@ -48,13 +48,13 @@ public class SLLogFile { queue.addOperation { [weak self] in guard let path = self?.filePath else { return } if FileManager.default.fileExists(atPath: path), - let data = "\n{%beging:log%}\(log){%end:log%}".data(using: .utf8) { + let data = "\n{%beging:log%}\(log)".data(using: .utf8) { if self?.fileHandle == nil { self?.fileHandle = FileHandle(forWritingAtPath: path) } _ = self?.fileHandle?.seekToEndOfFile() self?.fileHandle?.write(data) - } else if let _ = try? "{%beging:log%}\(log){%end:log%}".write(toFile: path, atomically: true, encoding: .utf8) { + } else if let _ = try? "{%beging:log%}\(log)".write(toFile: path, atomically: true, encoding: .utf8) { if let file = path.components(separatedBy: "/").last { self?.files.append(file) } diff --git a/Tests/SLLogTests/SLLogFileTests.swift b/Tests/SLLogTests/SLLogFileTests.swift index 89735c4..5907dcb 100644 --- a/Tests/SLLogTests/SLLogFileTests.swift +++ b/Tests/SLLogTests/SLLogFileTests.swift @@ -98,7 +98,7 @@ class SLLogFileTests: XCTestCase { let data = fileHandle.readDataToEndOfFile() fileHandle.closeFile() if let content = String(data: data, encoding: .utf8), - content.components(separatedBy: " ").last == "#%^$&@}" { + content.components(separatedBy: " ").last == "#%^$&@" { exp.fulfill() } else { XCTFail("incorrect message value")