Skip to content

Commit

Permalink
fix: log-level broken pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandGouny committed Mar 13, 2021
1 parent 4ce3ef0 commit 64faa55
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### Changed
- Multiple log line message are now split and log line by line for a nicest display.

### Fixed
- log-level broken pipe

# [1.3.2] - 2021-02-18
### Fixed
- Remove -x bash flag on log-helper tool
Expand Down
25 changes: 20 additions & 5 deletions image/tool/log-helper
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,51 @@ function print_log(){
}

function error() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 1 ]; then
getEchoParams $@
echo $echo_param "$(print_log " ERROR " "$echo_msg")"
fi
}

function warning() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 2 ]; then
getEchoParams $@
echo $echo_param "$(print_log "WARNING" "$echo_msg")"
fi
}

function info() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 3 ]; then
getEchoParams $@
echo $echo_param "$(print_log " INFO " "$echo_msg")"
fi
}

function debug() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 4 ]; then
getEchoParams $@
echo $echo_param "$(print_log " DEBUG " "$echo_msg")"
fi
}

function trace() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 5 ]; then
getEchoParams $@
echo $echo_param "$(print_log " TRACE " "$echo_msg")"
fi
}
Expand Down

0 comments on commit 64faa55

Please sign in to comment.