libretro-super/script-modules/log.sh
2015-03-27 18:31:51 -07:00

31 lines
625 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# vim: set ts=3 sw=3 noet ft=sh : bash
color() {
[ -n "$use_color" ] && echo -n "[0;${1:-0}m"
}
lecho() {
if [ -n "$LIBRETRO_LOG_SUPER" ]; then
echo "$@" >> $super_log
fi
}
LIBRETRO_LOG_DIR="${LIBRETRO_LOG_DIR:-$WORKDIR/log}"
LIBRETRO_LOG_CORE="${LIBRETRO_LOG_CORE:-%s.txt}"
LIBRETRO_LOG_SUPER="${LIBRETRO_LOG_SUPER:-libretro-super.txt}"
if [ -n "$LIBRETRO_LOG_SUPER" ]; then
super_log="$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_SUPER"
fi
# Core log can't be handled here
mkdir -p "$LIBRETRO_LOG_DIR"
if [[ -n $FORCE_COLOR || -t 1 && -z "$NO_COLOR" ]]; then
want_color=1
use_color=1
else
want_color=""
use_color=""
fi