John D Pell
5023b20d62
remove executable bit
2021-09-17 22:25:54 -07:00
John D Pell
85408743fa
lib/log: default to no logging at all
...
Set the default when BASH_IT_LOG_LEVEL is unbound to log level none: no warnings or errors are reported at all.
2021-08-26 14:11:41 -07:00
John D Pell
233fcc3091
lib/log: handle undefined variable
...
Expressly deal with if $echo_yellow hasn’t been defined
2021-08-26 14:11:41 -07:00
John D Pell
02c13b7921
lib/log: handle undefined variables
...
If the user hasn't defined BASH_IT_LOG_LEVEL, then the integer comparison fails. Handle it by defaulting to '1'.
If lib/log is loaded improperly, the BASH_IT_LOG_PREFIX may be undefined. Unlikely, but no harm in handling it too.
Likewise, if no theme is loaded, then $echo_green, $echo_normal, et al are not defined.
2021-08-26 14:11:41 -07:00
Noah Gorny
72dbfd2480
lib: log: Insert log level before message prefix
...
Also fix tests accordinly
2020-07-02 21:11:40 +03:00
Noah Gorny
e6ebcda608
log: Fix logging to comply with the tests
2020-07-02 21:11:40 +03:00
Noah Gorny
8a3cf76307
lib: Move _has_colors to log module
2020-07-02 20:13:42 +03:00
Noah Gorny
9a23725ce0
log: Add BASH_IT_LOG_PREFIX option
...
Also add a new test to check it
2020-06-25 00:16:16 +03:00
Noah Gorny
3e7a95660f
lib: Add _has_colors function and use it in log output
2020-06-23 15:42:22 +03:00
Noah Gorny
802c45b401
lib: Add log module
2020-06-23 15:12:43 +03:00