mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
This commit is contained in:
@@ -52,10 +52,15 @@ async function log(
|
|||||||
|
|
||||||
const { file, line, ...keyValues } = options ?? {};
|
const { file, line, ...keyValues } = options ?? {};
|
||||||
|
|
||||||
|
let location = filtered?.[0]?.filter((v) => v.length > 0).join("@");
|
||||||
|
if (location === "Error") {
|
||||||
|
location = "webview::unknown";
|
||||||
|
}
|
||||||
|
|
||||||
await invoke("plugin:log|log", {
|
await invoke("plugin:log|log", {
|
||||||
level,
|
level,
|
||||||
message,
|
message,
|
||||||
location: filtered?.[0]?.filter((v) => v.length > 0).join("@"),
|
location,
|
||||||
file,
|
file,
|
||||||
line,
|
line,
|
||||||
keyValues,
|
keyValues,
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ fn log(
|
|||||||
let location = location.unwrap_or("webview");
|
let location = location.unwrap_or("webview");
|
||||||
let mut builder = RecordBuilder::new();
|
let mut builder = RecordBuilder::new();
|
||||||
builder
|
builder
|
||||||
.target(location)
|
|
||||||
.level(level.into())
|
.level(level.into())
|
||||||
|
.target(location)
|
||||||
.file(file)
|
.file(file)
|
||||||
.line(line);
|
.line(line);
|
||||||
|
|
||||||
@@ -178,8 +178,8 @@ impl Default for Builder {
|
|||||||
out.finish(format_args!(
|
out.finish(format_args!(
|
||||||
"{}[{}][{}] {}",
|
"{}[{}][{}] {}",
|
||||||
DEFAULT_TIMEZONE_STRATEGY.get_now().format(&format).unwrap(),
|
DEFAULT_TIMEZONE_STRATEGY.get_now().format(&format).unwrap(),
|
||||||
record.target(),
|
|
||||||
record.level(),
|
record.level(),
|
||||||
|
record.target(),
|
||||||
message
|
message
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
@@ -213,8 +213,8 @@ impl Builder {
|
|||||||
out.finish(format_args!(
|
out.finish(format_args!(
|
||||||
"{}[{}][{}] {}",
|
"{}[{}][{}] {}",
|
||||||
timezone_strategy.get_now().format(&format).unwrap(),
|
timezone_strategy.get_now().format(&format).unwrap(),
|
||||||
record.target(),
|
|
||||||
record.level(),
|
record.level(),
|
||||||
|
record.target(),
|
||||||
message
|
message
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
@@ -273,8 +273,8 @@ impl Builder {
|
|||||||
out.finish(format_args!(
|
out.finish(format_args!(
|
||||||
"{}[{}][{}] {}",
|
"{}[{}][{}] {}",
|
||||||
timezone_strategy.get_now().format(&format).unwrap(),
|
timezone_strategy.get_now().format(&format).unwrap(),
|
||||||
record.target(),
|
|
||||||
colors.color(record.level()),
|
colors.color(record.level()),
|
||||||
|
record.target(),
|
||||||
message
|
message
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user