diff --git a/bin/compose-core b/bin/compose-core index 74bf402..d28e19e 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3850,6 +3850,10 @@ fi _setup_state_dir mkdir -p "$CACHEDIR" || exit 1 + +log () { cat; } +export -f log + ## ## Argument parsing ## @@ -3887,6 +3891,8 @@ while read-0 arg; do --quiet|-q) export QUIET=true export wrap_opts+=("-q") + log () { cat >&2; } + export -f log ;; --version|-V) print_version @@ -4081,6 +4087,10 @@ if [ -z "$is_docker_compose_action" -a "$action" ]; then esac } < <(has_service_action "$action_service" "$action") services_args=("$action_service") + + ## Divert logging to stdout to stderr + log () { cat >&2; } + export -f log else die "Unknown action '${DARKCYAN}$action$NORMAL': It doesn't match any docker-compose commands nor inner charm actions." fi @@ -4185,7 +4195,7 @@ if [ -n "$full_init" ]; then run_service_hook pre_deploy "${services_args[@]}" || exit 1 -fi +fi | log if [ "$action" == "run" -a "${#services_args}" != 0 ]; then charm=$(get_service_charm "${services_args[0]}") || exit 1