Sha256: 5f5252f3383c648e78b109ea1734c1f50fcf710fd9c161e2654eb219d5014f91

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env bash

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 [[ -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

6 entries across 6 versions & 1 rubygems

Version Path
rvm-0.1.41 scripts/log
rvm-0.1.40 scripts/log
rvm-0.1.39 scripts/log
rvm-0.1.38 scripts/log
rvm-0.1.37 scripts/log
rvm-0.1.36 scripts/log