diff --git a/docs/how_to_debug/README.md b/docs/how_to_debug/README.md index a41d390..a7c4155 100644 --- a/docs/how_to_debug/README.md +++ b/docs/how_to_debug/README.md @@ -6,6 +6,14 @@ Ideally, users do not need to debug anything. But if something bad happened, we See [here](./export_sync_plans.md). -## Advanced: Check Console Output +## Advanced: Check Console Output Directly + +...of desktop and Android. See [here](./check_console_output.md). + +## Advanced: Save Console Output Then Read Them Later + +This method works for desktop and mobile devices (iOS, Android). + +See [here](./save_console_output_and_export.md). diff --git a/docs/how_to_debug/check_console_output.md b/docs/how_to_debug/check_console_output.md index 28b5ff0..b5c581f 100644 --- a/docs/how_to_debug/check_console_output.md +++ b/docs/how_to_debug/check_console_output.md @@ -1,6 +1,6 @@ # Check Console Output -If you are using Obsidian on desktop, you can check the Obsidian console. +If you are using Obsidian on desktop or Android, you can check the Obsidian console. ## Disable Auto Sync Firstly @@ -12,6 +12,12 @@ Go to the plugin settings, scroll down to the section "Debug" -> "alter console ## Check The Output -Then, press the keyboard shortcut "ctrl+shift+i" if you are on Windows or Linux, or press "cmd+shift+i" if you are on macOS. You should be able to see the console of Obsidian. +- If you are on desktop + + Press the keyboard shortcut "ctrl+shift+i" if you are on Windows or Linux, or press "cmd+shift+i" if you are on macOS. You should be able to see the console of Obsidian. + +- If you are using Android + + You need to [enable USB debugging](https://developer.android.com/studio/debug/dev-options#enable) on your Android, then connect your Android to a computer using USB, then open the **desktop** Chrome browser and go to the special web page . You shall be able to see the "inspect" link inside the special page, then click the link to open the console. After debugging, remember to turn off USB debugging. Trigger the sync manually (by clicking the icon on the ribbon sidebar). Something (hopefully) helpful should show up in the console. You could understand what happened and what goes wrong more explictly by checking the output. diff --git a/docs/how_to_debug/save_console_output_and_export.md b/docs/how_to_debug/save_console_output_and_export.md new file mode 100644 index 0000000..28b46ed --- /dev/null +++ b/docs/how_to_debug/save_console_output_and_export.md @@ -0,0 +1,25 @@ +# Save Console Output And Read Them Later + +## Disable Auto Sync Firstly + +You should disable auto sync to avoid any unexpected running. + +## Set The Output Level To Debug + +Go to the plugin settings, scroll down to the section "Debug" -> "alter console log level", and change it from "info" to "debug". + +## Enable Saving The Output To DB + +Go to the plugin settings, scroll down to the section "Debug" -> "Save Console Logs Into DB", and change it from "disable" to "enable". **This setting has some performance cost, so do NOT always turn this on when not necessary!** + +## Run The Sync + +Trigger the sync manually (by clicking the icon on the ribbon sidebar). Something (hopefully) helpful should show up in the console. The the console logs are also saved into DB now. + +## Export The Output And Read The Logs + +Go to the plugin settings, scroll down to the section "Debug" -> "Export Console Logs From DB", and click the button. A new file `log_hist_exported_on_....md` should be created inside the special folder `_debug_remotely_save/`. You could read it and hopefully find something useful. + +## Disable Saving The Output To DB + +After debugging, go to the plugin settings, scroll down to the section "Debug" -> "Save Console Logs Into DB", and change it from "enable" to "disable".