From 862c1547939e3e4d91ff5e3f0829fc7301a0a3a4 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Sat, 20 Jun 2020 20:36:12 +0300 Subject: [PATCH] docs: Add bash-it doctor and logs documentation --- DEVELOPMENT.md | 9 +++++++++ README.md | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 33276b71..5328cc78 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,6 +2,15 @@ This page summarizes a couple of rules to keep in mind when developing features or making changes in Bash-it. +## Debugging and Logging + +While developing feature or making changes in general, you can log error/warning/debug +using `_log_error` `_log_warning` and `_log_debug`. This will help you solve problems quicker +and also propagate important notes to other users of Bash-it. +You can see the logs by using `bash-it doctor` command to reload and see the logs. +Alternatively, you can set `BASH_IT_LOG_LEVEL` to `BASH_IT_LOG_LEVEL_ERROR`, `BASH_IT_LOG_LEVEL_WARNING` or `BASH_IT_LOG_LEVEL_ALL`. + + ## Load Order ### General Load Order diff --git a/README.md b/README.md index a696894e..26ac5cb7 100644 --- a/README.md +++ b/README.md @@ -417,6 +417,20 @@ Unset `BASH_IT_LEGACY_PASS` to have Bash-it **return to default behavior**: * `unset BASH_IT_LEGACY_PASS` +### Debugging + +If you encounter problems with any part of Bash-it, run the following command: +```bash +bash-it doctor +``` +This will reload your bash profile and print out logs of various parts in Bash-it. +Note that this command at default will print all logs, including debug logs. +You can call it like this: +```bash +bash-it doctor [errors/warnings/all] +``` +In order to get wanted verbosity. + ### Proxy Support If you are working in a corporate environment where you have to go through a proxy server for internet access,