Sha256: ace4cf777a3357bca5a9e1e0ab064801d2c264c191fa3921d21adc969e1353ce

Contents?: true

Size: 1.03 KB

Versions: 18

Compression:

Stored size: 1.03 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="${1//\%/%%}"

if [[ ${rvm_pretty_print_flag:-0} -eq 0 ]] ; then

  if [[ ${rvm_verbose_flag:-0} -gt 0 && -n "$level" ]] ; then
    message="$level: $message"
  fi

  case "$level" in
    info)       printf "${message#*: }\n" ;;
    debug|warn) printf "$message\n" ;;
    error|fail) printf "$message\n" >&2  ;;
    *) printf "$message"
  esac

else

  case "$level" in
    debug) printf "$(tput setaf 5)$level$(tput sgr0): $message\n"     ;;
    info)  printf "$(tput setaf 2)$level$(tput sgr0): $message\n"     ;;
    warn)  printf "$(tput setaf 3)$level$(tput sgr0): $message\n"     ;;
    error) printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
    fail)  printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
    *)     printf "$message"
  esac

fi

exit 0

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rvm-1.0.21 scripts/log
rvm-1.0.20 scripts/log
rvm-1.0.19 scripts/log
rvm-1.0.18 scripts/log
rvm-1.0.17 scripts/log
rvm-1.0.15 scripts/log
gemrage-1.0.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.4.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.4.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.3.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.3.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.3.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.2.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
gemrage-0.1.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log
rvm-1.0.14 scripts/log
rvm-1.0.13 scripts/log
rvm-1.0.11 scripts/log
rvm-1.0.10 scripts/log