Sha256: 4fea6f05fc93b86a73f3de43668629309dc5fb200c5edb6c654b32d257db0207

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env bash

# When rvm_silence_logging is set, don't show anything.
[[ -n "$rvm_silence_logging" ]] && exit 0

if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi

if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi

message="$(echo "$1" | sed 's/%/%%/g')"

if [[ -z "$rvm_interactive" ]] || [[ -z "$TERM" ]] || [[ "unknown" = "$TERM" ]] ; then
  case "$level" in
    debug) shift ; printf "\n$level: $message\n"     ;;
    info)  shift ; printf "\n$level: $message\n"     ;;
    warn)  shift ; printf "\n$level: $message\n"     ;;
    error) shift ; printf "\n$level: $message\n" >&2 ;;
    fail)  shift ; printf "\n$level: $message\n" >&2 ;;
    *) printf "$message"
  esac
else
  case "$level" in
    debug) shift ; printf "\n$(tput setaf 5)$level$(tput sgr0): $message\n"     ;;
    info)  shift ; printf "\n$(tput setaf 2)$level$(tput sgr0): $message\n"     ;;
    warn)  shift ; printf "\n$(tput setaf 3)$level$(tput sgr0): $message\n"     ;;
    error) shift ; printf "\n$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
    fail)  shift ; printf "\n$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
    *) printf "$message"
  esac
fi

exit 0

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rvm-1.0.0 scripts/log
rvm-0.1.47 scripts/log
rvm-0.1.46 scripts/log
rvm-0.1.45 scripts/log
rvm-0.1.44 scripts/log
rvm-0.1.43 scripts/log
rvm-0.1.42 scripts/log