From 11d98e911e455d16c447ad8293e181fee4894808 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Sun, 10 Mar 2024 13:21:17 +0100 Subject: [PATCH] chore(log): Fix lint and formatting --- plugins/log/guest-js/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index e12add7d..057b113c 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -189,13 +189,14 @@ type LoggerFn = (fn: RecordPayload) => void; /** * Attaches a listener for the log, and calls the passed function for each log entry. * @param fn - * + * * @returns a function to cancel the listener. */ export async function attachLogger(fn: LoggerFn): Promise { return await listen("log://log", (event: Event) => { - let { message, level } = event.payload; - + const { level } = event.payload; + let { message } = event.payload; + // Strip ANSI escape codes message = message.replace( // TODO: Investigate security/detect-unsafe-regex @@ -209,7 +210,7 @@ export async function attachLogger(fn: LoggerFn): Promise { /** * Attaches a listener that writes log entries to the console as they come in. - * + * * @returns a function to cancel the listener. */ export async function attachConsole(): Promise {