Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Jul 10, 2024
1 parent 0842d3f commit 8b551ec
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public struct RuntimeWarningReporter: IssueReporter {
dso: dso,
log: OSLog(subsystem: "com.apple.runtime-issues", category: moduleName),
"%@",
"\(isTesting ? "􀢄 \(fileID):\(line): " : "")\(message)"
"\(isTesting ? "\(fileID):\(line): " : "")\(message)"
)
#else
fputs("\(fileID):\(line): \(message() ?? "")\n", stderr)
#endif
}

public func expectIssue(
_ message: @autoclosure () -> String,
_ message: @autoclosure () -> String?,
fileID: StaticString,
filePath: StaticString,
line: UInt,
Expand All @@ -86,11 +86,15 @@ public struct RuntimeWarningReporter: IssueReporter {
let moduleName = String(
Substring("\(fileID)".utf8.prefix(while: { $0 != UTF8.CodeUnit(ascii: "/") }))
)
var message = message() ?? ""
if message.isEmpty {
message = "Issue expected"
}
os_log(
.info,
log: OSLog(subsystem: "co.pointfree.expected-issues", category: moduleName),
"%@",
message()
"\(isTesting ? "\(fileID):\(line): " : "")\(message)"
)
#else
fputs("\(fileID):\(line): \(message() ?? "")\n", stdout)
Expand Down

0 comments on commit 8b551ec

Please sign in to comment.