Skip to content

Commit 9629c2f

Browse files
exoegoLegend-Mastervenkr
authored
[v2][log]: Add generic fern::Dispatch TargetKind to log (#2600)
* [v2][log]: Add generic fern::Dispatch TargetKind to log Original: b691382 * Add change file * clippy --------- Co-authored-by: Tony <[email protected]> Co-authored-by: venkr <[email protected]>
1 parent d160991 commit 9629c2f

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
log: minor
3+
log-js: minor
4+
---
5+
6+
Adds a new varient `TargetKind::Dispatch` that allows you to construct arbitrary log targets

plugins/log/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ pub enum TargetKind {
170170
///
171171
/// This requires the webview to subscribe to log events, via this plugins `attachConsole` function.
172172
Webview,
173+
/// Send logs to a [`fern::Dispatch`]
174+
///
175+
/// You can use this to construct arbitrary log targets.
176+
Dispatch(fern::Dispatch),
173177
}
174178

175179
/// A log target.
@@ -481,6 +485,7 @@ impl Builder {
481485
});
482486
})
483487
}
488+
TargetKind::Dispatch(dispatch) => dispatch.into(),
484489
};
485490
target_dispatch = target_dispatch.chain(logger);
486491

plugins/shell/permissions/schemas/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@
355355
"markdownDescription": "Denies the stdin_write command without any pre-configured scope."
356356
},
357357
{
358-
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n",
358+
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`",
359359
"type": "string",
360360
"const": "default",
361-
"markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality without any specific\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`"
361+
"markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`"
362362
}
363363
]
364364
}

plugins/shell/src/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl ShellScope<'_> {
304304
.map(|s| {
305305
std::path::PathBuf::from(s)
306306
.components()
307-
.last()
307+
.next_back()
308308
.unwrap()
309309
.as_os_str()
310310
.to_string_lossy()

0 commit comments

Comments
 (0)