Conversation
|
/cc @niieani @tterranigma |
niieani
left a comment
There was a problem hiding this comment.
Please change the variable name and revert the formatting of the files so it is consistent. I presume you used some auto-formatter on the file, hence it rolled together the if/thens?
Thanks.
lib/util/log.sh
Outdated
| if [[ ! -z ${__oo__loggers["$logger"]} ]] | ||
| then | ||
| ${__oo__loggers["$logger"]} "$@" | ||
| if [[ ! -z ${__oo__loggers["$logger"]} ]]; then |
There was a problem hiding this comment.
The repository uses syntax with a new line, so I'd prefer to keep it consistent.
lib/util/log.sh
Outdated
| for logger in "${loggers[@]}" | ||
| do | ||
| loggers=(${loggerList//;/ }) | ||
| for logger in "${loggers[@]}"; do |
There was a problem hiding this comment.
The repository uses syntax with a new line, so I'd prefer to keep it consistent.
lib/util/log.sh
Outdated
| then | ||
| if [[ -z $logged ]] || [[ ${__oo__logDisabledFilter["$scope"]} == true ]] | ||
| then | ||
| if [[ ! -z "${__oo__logScopeOutputs["$scope"]}" ]]; then |
There was a problem hiding this comment.
The repository uses syntax with a new line, so I'd prefer to keep it consistent.
lib/util/log.sh
Outdated
| declare -Ag __oo__loggers | ||
|
|
||
| # Controls verbosity of the script output and logging. | ||
| VERBOSE="${VERBOSE:-5}" |
There was a problem hiding this comment.
I'd use something like __oo__verbosity for the variable name, VERBOSE can conflict with a user-space variable of the same name.
Ideally, we'd set this variable with some configuration function, but I can accept this as a temporary workaround.
There was a problem hiding this comment.
the variable VERBOSE is for user to set.
Just like the example, before or after users import util/log, they can set/change the VERBOSE level by themselves to determine which log will be displayed
VERBOSE=2
Log::AddOutput test/verbose DEBUG
Log "this log will be displayed"
V=2 Log "this log will be displayed"
VERBOSE=1
V=2 Log "this log will not be displayed"
|
ping @niieani And |
Example