Skip to content

Commit

Permalink
Remove javascript logging. (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored Jul 15, 2024
1 parent 9085501 commit 8390ca8
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Sources/Dependencies/Internal/RuntimeWarnings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ func runtimeWarn(
message
)
#elseif os(WASI)
#if canImport(JavaScriptCore)
let timestamp = JSContext()?.evaluateScript("new Date().toISOString()").toString()
print("\(timestamp.map { "\($0) " } ?? "")[\(category)] \(message)")
#elseif canImport(JavaScriptKit)
JSObjectRef.global.console.warn.callWithArguments([
"\(JSObjectRef.global.Date.new().toISOString()) [\(category)] \(message)"
])
#else
print("[\(category)] \(message)")
#endif
print("[\(category)] \(message)")
#else
fputs("\(formatter.string(from: Date())) [\(category)] \(message)\n", stderr)
#endif
Expand Down Expand Up @@ -71,12 +62,6 @@ func runtimeWarn(
}
return UnsafeMutableRawPointer(mutating: #dsohandle)
}())
#elseif os(WASI)
#if canImport(JavaScriptCore)
import JavaScriptCore
#elseif canImport(JavaScriptKit)
import JavaScriptKit
#endif
#else
import Foundation

Expand Down

0 comments on commit 8390ca8

Please sign in to comment.