Sha256: 6264648d7167bb72e5da84e935c35fa7f2fac1077f2b2926621333b079e6fd02

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 Bytes

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 ; echo -e "<d>$message </d>"     ;;
    info)  shift ; echo -e "<i>$message </i>"     ;;
    warn)  shift ; echo -e "<w>$message </w>"     ;;
    error) shift ; echo -e "<e>$message </e>" >&2 ;;
    fail)  shift ; echo -e "<f>$message </f>" >&2 ;;
    *) echo -e "$message"
  esac
else
  case "$level" in
    debug) shift ; echo -e "$(tput setaf 5)$message$(tput sgr0)"     ;;
    info)  shift ; echo -e "$(tput setaf 2)$message$(tput sgr0)"     ;;
    warn)  shift ; echo -e "$(tput setaf 3)$message$(tput sgr0)"     ;;
    error) shift ; echo -e "$(tput setaf 1)$message$(tput sgr0)" >&2 ;;
    fail)  shift ; echo -e "$(tput setaf 1)$message$(tput sgr0)" >&2 ;;
    *) echo -e "$message"
  esac
fi

exit 0

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rvm-0.1.32 scripts/log
rvm-0.1.31 scripts/log
rvm-0.1.30 scripts/log
rvm-0.1.29 scripts/log