./libretro-build.sh --nologs to disable logging

This commit is contained in:
T. Joseph Carter 2015-03-28 20:30:22 -07:00
parent 1a30a6a1a1
commit a540056414
2 changed files with 26 additions and 10 deletions

View File

@ -180,17 +180,24 @@ fi
if [ -n "$1" ]; then
while [ -n "$1" ]; do
case "$1" in
build_libretro_*)
# "Old"-style
$1
--nologs)
LIBRETRO_LOG_SUPER=""
LIBRETRO_LOG_CORE=""
;;
*)
# New style (just generic cores for now)
libretro_build_core $1
want_cores="$want_cores $1"
;;
esac
shift
done
fi
libretro_log_init
if [ -n "$want_cores" ]; then
for core in $want_cores; do
libretro_build_core $core
done
else
build_default_cores
fi

View File

@ -14,14 +14,23 @@ lecho() {
LIBRETRO_LOG_DIR="${LIBRETRO_LOG_DIR:-$WORKDIR/log}"
LIBRETRO_LOG_CORE="${LIBRETRO_LOG_CORE:-%s.log}"
LIBRETRO_LOG_SUPER="${LIBRETRO_LOG_SUPER:-libretro-super.log}"
if [ -n "$LIBRETRO_LOG_SUPER" ]; then
libretro_log_init() {
if [ -z "$LIBRETRO_LOG_SUPER" -a -z "$LIBRETRO_LOG_CORE" ]; then
return
fi
if [ -n "$LIBRETRO_LOG_SUPER" ]; then
log_super="$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_SUPER"
[ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_super
fi
# Core log can't be handled here
fi
# Core log can't be truncated here
mkdir -p "$LIBRETRO_LOG_DIR"
mkdir -p "$LIBRETRO_LOG_DIR"
}
# TODO: Move this into libretro_log_init once libretro-fetch is fixed
if [[ -n $FORCE_COLOR || -t 1 && -z "$NO_COLOR" ]]; then
want_color=1
use_color=1