fix(log): Avoid type conflict (#347)

* Avoid type conflict

* Prettier format

* Make extras optional

* Rename extras to keyValues

* Remove empty initial object
pull/349/head
Tai Zeming 2 years ago committed by GitHub
parent 146004129e
commit 5e5221e0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,8 @@ import { listen, UnlistenFn } from "@tauri-apps/api/event";
export type LogOptions = {
file?: string;
line?: number;
} & Record<string, string | undefined>;
keyValues?: Record<string, string | undefined>;
};
enum LogLevel {
/**
@ -50,7 +51,7 @@ async function log(
return name.length > 0 && location !== "[native code]";
});
const { file, line, ...keyValues } = options ?? {};
const { file, line, keyValues } = options ?? {};
let location = filtered?.[0]?.filter((v) => v.length > 0).join("@");
if (location === "Error") {

Loading…
Cancel
Save