Add log level selection to help menu (#511)
* Add log level selection to help menu * Show keyboard shortcuts in loglevel menu items
This commit is contained in:
parent
492025e79b
commit
62fc269b8a
|
|
@ -170,7 +170,21 @@ function makeMenuEntries(editor: EditorState): MenuListEntries {
|
|||
{ label: "Report a Bug", action: (): unknown => window.open("https://github.com/GraphiteEditor/Graphite/issues/new", "_blank") },
|
||||
{ label: "Visit on GitHub", action: (): unknown => window.open("https://github.com/GraphiteEditor/Graphite", "_blank") },
|
||||
],
|
||||
[{ label: "Debug: Panic (DANGER)", action: async (): Promise<void> => editor.rawWasm.intentional_panic() }],
|
||||
[
|
||||
{
|
||||
label: "Debug: Set Log Level",
|
||||
// TODO: Remove empty action after merge of (https://github.com/GraphiteEditor/Graphite/pull/338)
|
||||
action: (): void => undefined,
|
||||
children: [
|
||||
[
|
||||
{ label: "Log Level Info", action: async (): Promise<void> => editor.instance.log_level_info(), shortcut: ["Key1"] },
|
||||
{ label: "Log Level Debug", action: async (): Promise<void> => editor.instance.log_level_debug(), shortcut: ["Key2"] },
|
||||
{ label: "Log Level Trace", action: async (): Promise<void> => editor.instance.log_level_trace(), shortcut: ["Key3"] },
|
||||
],
|
||||
],
|
||||
},
|
||||
{ label: "Debug: Panic (DANGER)", action: async (): Promise<void> => editor.rawWasm.intentional_panic() },
|
||||
],
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -220,6 +220,21 @@ impl JsEditorHandle {
|
|||
self.dispatch(message);
|
||||
}
|
||||
|
||||
pub fn log_level_info(&self) {
|
||||
let message = GlobalMessage::LogInfo;
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
pub fn log_level_debug(&self) {
|
||||
let message = GlobalMessage::LogDebug;
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
pub fn log_level_trace(&self) {
|
||||
let message = GlobalMessage::LogTrace;
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
/// Send new bounds when document panel viewports get resized or moved within the editor
|
||||
/// [left, top, right, bottom]...
|
||||
pub fn bounds_of_viewports(&self, bounds_of_viewports: &[f64]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue