chore(log): Fix lint and formatting

pull/1031/head
FabianLars 1 year ago
parent 30295ecc8e
commit 11d98e911e
No known key found for this signature in database

@ -189,13 +189,14 @@ type LoggerFn = (fn: RecordPayload) => void;
/** /**
* Attaches a listener for the log, and calls the passed function for each log entry. * Attaches a listener for the log, and calls the passed function for each log entry.
* @param fn * @param fn
* *
* @returns a function to cancel the listener. * @returns a function to cancel the listener.
*/ */
export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> { export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> {
return await listen("log://log", (event: Event<RecordPayload>) => { return await listen("log://log", (event: Event<RecordPayload>) => {
let { message, level } = event.payload; const { level } = event.payload;
let { message } = event.payload;
// Strip ANSI escape codes // Strip ANSI escape codes
message = message.replace( message = message.replace(
// TODO: Investigate security/detect-unsafe-regex // TODO: Investigate security/detect-unsafe-regex
@ -209,7 +210,7 @@ export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> {
/** /**
* Attaches a listener that writes log entries to the console as they come in. * Attaches a listener that writes log entries to the console as they come in.
* *
* @returns a function to cancel the listener. * @returns a function to cancel the listener.
*/ */
export async function attachConsole(): Promise<UnlistenFn> { export async function attachConsole(): Promise<UnlistenFn> {

Loading…
Cancel
Save