mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-03 03:12:29 +00:00
enh: watch instance logging
This commit is contained in:
parent
c5173e0380
commit
c0bfc643a4
@ -256,7 +256,7 @@ export const createPocketbaseClient = (config: PocketbaseClientConfig) => {
|
||||
update: (log: InstanceLogFields) => void,
|
||||
nInitial = 100
|
||||
): (() => void) => {
|
||||
const { dbg } = _logger.create('watchInstanceLog')
|
||||
const { dbg, trace } = _logger.create('watchInstanceLog')
|
||||
const auth = client.authStore.exportToCookie()
|
||||
|
||||
const controller = new AbortController()
|
||||
@ -274,10 +274,10 @@ export const createPocketbaseClient = (config: PocketbaseClientConfig) => {
|
||||
auth
|
||||
}),
|
||||
onmessage: (event) => {
|
||||
dbg(`Got stream event`, event)
|
||||
trace(`Got stream event`, event)
|
||||
const {} = event
|
||||
const log = JSON.parse(event.data) as InstanceLogFields
|
||||
dbg(`Log is`, log)
|
||||
trace(`Log is`, log)
|
||||
update(log)
|
||||
},
|
||||
onopen: async (response) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user