mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-27 11:56:05 +02:00
chore(log): Fix lint and formatting
This commit is contained in:
@@ -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<UnlistenFn> {
|
||||
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
|
||||
message = message.replace(
|
||||
// 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.
|
||||
*
|
||||
*
|
||||
* @returns a function to cancel the listener.
|
||||
*/
|
||||
export async function attachConsole(): Promise<UnlistenFn> {
|
||||
|
||||
Reference in New Issue
Block a user