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,
|
update: (log: InstanceLogFields) => void,
|
||||||
nInitial = 100
|
nInitial = 100
|
||||||
): (() => void) => {
|
): (() => void) => {
|
||||||
const { dbg } = _logger.create('watchInstanceLog')
|
const { dbg, trace } = _logger.create('watchInstanceLog')
|
||||||
const auth = client.authStore.exportToCookie()
|
const auth = client.authStore.exportToCookie()
|
||||||
|
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
@ -274,10 +274,10 @@ export const createPocketbaseClient = (config: PocketbaseClientConfig) => {
|
|||||||
auth
|
auth
|
||||||
}),
|
}),
|
||||||
onmessage: (event) => {
|
onmessage: (event) => {
|
||||||
dbg(`Got stream event`, event)
|
trace(`Got stream event`, event)
|
||||||
const {} = event
|
const {} = event
|
||||||
const log = JSON.parse(event.data) as InstanceLogFields
|
const log = JSON.parse(event.data) as InstanceLogFields
|
||||||
dbg(`Log is`, log)
|
trace(`Log is`, log)
|
||||||
update(log)
|
update(log)
|
||||||
},
|
},
|
||||||
onopen: async (response) => {
|
onopen: async (response) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user