mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 16:42:01 +00:00
test logger that should work now
This commit is contained in:
parent
30a194f5b8
commit
01f90882f9
1 changed files with 11 additions and 4 deletions
|
|
@ -16,6 +16,13 @@ class JSController: ObservableObject {
|
|||
}
|
||||
|
||||
private func setupContext() {
|
||||
let consoleObject = JSValue(newObjectIn: context)
|
||||
let consoleLogFunction: @convention(block) (String) -> Void = { message in
|
||||
Logger.shared.log(message, type: "Debug")
|
||||
}
|
||||
consoleObject?.setObject(consoleLogFunction, forKeyedSubscript: "log" as NSString)
|
||||
context.setObject(consoleObject, forKeyedSubscript: "console" as NSString)
|
||||
|
||||
let logFunction: @convention(block) (String) -> Void = { message in
|
||||
Logger.shared.log("JavaScript log: \(message)", type: "Debug")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue