From 77458de033ce302d259e95b9a66c525fcf822dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 26 Aug 2021 15:24:12 +0200 Subject: Log messages at {info,notice,verbose} and {,-v,-vv}. --- build.sh | 12 ++++++------ etc/build.usage | 16 ++++++++-------- etc/build.usage.short | 14 ++++++++++---- subr.rtl/rtl_fileop.subr | 2 +- subr.rtl/rtl_log.subr | 1 + subr.rtl/rtl_platform.subr | 4 ++-- subr/build_init.subr | 4 ++-- subr/ex_pkg.subr | 2 +- subr/ex_pkg_dispatch.subr | 4 ++-- subr/pkg_fetch_download.subr | 2 +- 10 files changed, 34 insertions(+), 27 deletions(-) diff --git a/build.sh b/build.sh index 950bb199..c68f7a12 100755 --- a/build.sh +++ b/build.sh @@ -18,14 +18,14 @@ buildp_ast() { fi; done; if [ -n "${_pids}" ]; then - rtl_log_msg notice "Killed PID(s): %s" "$(rtl_uniq ${_pids})"; + rtl_log_msg verbose "Killed PID(s): %s" "$(rtl_uniq ${_pids})"; fi; if [ -n "${EX_PKG_DISPATCH_WAIT}" ]\ && [ "${ARG_RESET_PKG}" -eq 1 ]; then for _pkg_name in ${EX_PKG_DISPATCH_WAIT}; do rtl_state_clear "${BUILD_WORKDIR}" "${_pkg_name}"; done; - rtl_log_msg notice "Reset package state for: %s" "${EX_PKG_DISPATCH_WAIT}"; + rtl_log_msg verbose "Reset package state for: %s" "${EX_PKG_DISPATCH_WAIT}"; fi; if [ -n "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then rtl_fileop rm "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}"; @@ -65,12 +65,12 @@ buildp_dispatch_group_state() { buildp_dispatch_pkg_state() { local _msg="${1}" _group_name="${2}" _pkg_name="${3}"; case "${_msg}" in - disabled_pkg) : $((BUILD_NSKIP+=1)); rtl_log_msg verbose "Skipping disabled package \`%s'." "${_pkg_name}"; ;; + disabled_pkg) : $((BUILD_NSKIP+=1)); rtl_log_msg notice "Skipping disabled package \`%s'." "${_pkg_name}"; ;; missing_pkg) rtl_log_msg fatalexit "Error: unknown package \`%s'." "${_pkg_name}"; ;; - msg_pkg) shift 3; rtl_log_msg verbose "%s/%s: %s" "${_group_name}" "${_pkg_name}" "${*}"; ;; - skipped_pkg) : $((BUILD_NSKIP+=1)); rtl_log_msg verbose "Skipping finished package \`%s'." "${_pkg_name}"; ;; + msg_pkg) shift 3; rtl_log_msg notice "%s/%s: %s" "${_group_name}" "${_pkg_name}" "${*}"; ;; + skipped_pkg) : $((BUILD_NSKIP+=1)); rtl_log_msg notice "Skipping finished package \`%s'." "${_pkg_name}"; ;; start_pkg) rtl_log_msg info "[%3d%%/%3d%%] [%03d/%03d] Starting \`%s' build..." "${7}" "${6}" "${4}" "${5}" "${_pkg_name}"; ;; - step_pkg) rtl_log_msg verbose "Finished build step %s of package \`%s'." "${4}" "${_pkg_name}"; ;; + step_pkg) rtl_log_msg notice "Finished build step %s of package \`%s'." "${4}" "${_pkg_name}"; ;; finish_pkg) : $((BUILD_NFINI+=1)); if rtl_lmatch "${ARG_VERBOSE_LEVELS}" "build" ","; then diff --git a/etc/build.usage b/etc/build.usage index 93b9702a..ca77a508 100644 --- a/etc/build.usage +++ b/etc/build.usage @@ -1,7 +1,7 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] [-F ipv4|ipv6|offline] [-h|--help] [-p jobs|-P] [-r ALL|LAST] - [-r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]] - [-R] [-v[v]] [-V level[,..]] [-x] + [-r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]] [-R] + [-v[v]] [-V {notice,verbose,build,fileops,install,xtrace}] [-x] [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] [--roar] [[=]<group>|<variable name>=<variable override>[ ..]] @@ -57,14 +57,14 @@ -R Ignore build failures, skip printing package logs, and continue building (relaxed mode.) - -v[v] -v: log at notice, -vv: log at verbose level. + -v[v] -v: log at info, notice, -vv: log at info, notice, verbose level. -V level[,..] Be verbose concerning any of: notice...: log at notice level (-v,) - verbose..: log at verbose level (-vv,) - build....: always print package build logs, - fileops..: log RTL file operations, - install..: log RTL installation DSL operations, - xtrace...: set xtrace during package builds (-x.) + verbose..: log at verbose level (implies notice) (-vv,) + build....: always print package build logs (implies notice,) + fileops..: log RTL file operations (implies notice,) + install..: log RTL installation DSL operations (implies notice,) + xtrace...: set xtrace during package builds (implies notice) (-x.) -x Set xtrace during package builds. --as-needed Don't build unless the midipix_build repository has received diff --git a/etc/build.usage.short b/etc/build.usage.short index b55b4900..715f2a64 100644 --- a/etc/build.usage.short +++ b/etc/build.usage.short @@ -1,7 +1,7 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] [-F ipv4|ipv6|offline] [-h|--help] [-p jobs|-P] [-r ALL|LAST] - [-r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]] - [-R] [-v[v]] [-V level[,..]] [-x] + [-r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]] [-R] + [-v[v]] [-V {notice,verbose,build,fileops,install,xtrace}] [-x] [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] [--roar] [[=]<group>|<variable name>=<variable override>[ ..]] @@ -12,8 +12,14 @@ -p jobs|-P Enables parallelisation at group-level, whenever applicable. -r ALL|LAST Restart all/the last failed/the specified comma-separated package(s). -r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..] - -v[v] -v: log at notice, -vv: log at verbose level. - -x Set xtrace during package builds. + -v[v] -v: log at info, notice, -vv: log at info, notice, verbose level. + -V level[,..] Be verbose concerning any of: + notice...: log at notice level (-v,) + verbose..: log at verbose level (implies notice) (-vv,) + build....: always print package build logs (implies notice,) + fileops..: log RTL file operations (implies notice,) + install..: log RTL installation DSL operations (implies notice,) + xtrace...: set xtrace during package builds (implies notice) (-x.) <group>[ ..] One of: dev_packages, dist, host_deps, host_deps_rpm, host_toolchain, host_tools, minipix, native_packages, diff --git a/subr.rtl/rtl_fileop.subr b/subr.rtl/rtl_fileop.subr index 53666eaf..d69cead7 100644 --- a/subr.rtl/rtl_fileop.subr +++ b/subr.rtl/rtl_fileop.subr @@ -18,7 +18,7 @@ rtlp_fileop_check() { rtlp_fileop_log() { local _msg="${1}"; if [ "${RTLP_FILEOP_LOG:-0}" -eq 1 ]; then - rtl_log_msg debug "${_msg}"; + rtl_log_msg notice "${_msg}"; fi; }; diff --git a/subr.rtl/rtl_log.subr b/subr.rtl/rtl_log.subr index b91d1374..cc692795 100644 --- a/subr.rtl/rtl_log.subr +++ b/subr.rtl/rtl_log.subr @@ -53,6 +53,7 @@ rtl_log_env_vars() { rtl_log_msg() { local _lvl="${1}" _fmt="${2}" _attr=""; shift 2; case "${RTLP_LOG_LVL:-0}" in + -1) rtl_lmatch "info notice verbose debug" "${_lvl}" && return; ;; 0) rtl_lmatch "notice verbose debug" "${_lvl}" && return; ;; 1) rtl_lmatch "verbose debug" "${_lvl}" && return; ;; 2) rtl_lmatch "debug" "${_lvl}" && return; ;; diff --git a/subr.rtl/rtl_platform.subr b/subr.rtl/rtl_platform.subr index ac411c87..d510254a 100644 --- a/subr.rtl/rtl_platform.subr +++ b/subr.rtl/rtl_platform.subr @@ -86,9 +86,9 @@ rtl_rc() { local _nflag="${1}" _cmd="${2}"; shift 2; case "${_nflag}" in 1) if [ "${#}" -gt 0 ]; then - rtl_log_msg notice "Command line: %s %s" "${_cmd}" "${*}"; + rtl_log_msg verbose "Command line: %s %s" "${_cmd}" "${*}"; else - rtl_log_msg notice "Command line: %s" "${_cmd}"; + rtl_log_msg verbose "Command line: %s" "${_cmd}"; fi; ;; *) "${_cmd}" "${@}"; esac; diff --git a/subr/build_init.subr b/subr/build_init.subr index 3d8a42c9..c677f3ab 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -237,8 +237,8 @@ buildp_init_getopts() { notice) rtl_log_set_lvl 1; ;; verbose) rtl_log_set_lvl 2; ;; build|install|xtrace) - ;; - fileops) rtl_fileop_set_log 1; ;; + rtl_log_set_lvl 1; ;; + fileops) rtl_log_set_lvl 1; rtl_fileop_set_log 1; ;; *) _rc=1; _status="Error: invalid verbosity level \`${_level}'"; ;; esac; done; diff --git a/subr/ex_pkg.subr b/subr/ex_pkg.subr index c1140d4a..90cdf3ca 100644 --- a/subr/ex_pkg.subr +++ b/subr/ex_pkg.subr @@ -120,7 +120,7 @@ ex_pkg_load_vars() { ../midipix_build.vars \ ./midipix.env; do if [ -r "${_fname}" ]; then - rtl_log_msg notice "Sourcing \`%s'." "${_fname}"; + rtl_log_msg verbose "Sourcing \`%s'." "${_fname}"; rtl_fileop source "${_fname}"; fi; done; diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr index 4f6c3744..255aeccc 100644 --- a/subr/ex_pkg_dispatch.subr +++ b/subr/ex_pkg_dispatch.subr @@ -230,10 +230,10 @@ ex_pkg_dispatch() { _perc_group="$(rtl_percentage "${EXP_PKG_DISPATCH_GROUP_CUR}" "${EXP_PKG_DISPATCH_GROUP_MAX}")"; if "${_dispatch_fn}" start_group "${_group_name}" "" "${EXP_PKG_DISPATCH_GROUP_CUR}" "${EXP_PKG_DISPATCH_GROUP_MAX}" "${_perc_group}"; then if rtl_fileop mkdir "${_workdir}"\ - && rtl_log_msg notice "Resolving \`%s' dependencies..." "${_group_name}"\ + && rtl_log_msg verbose "Resolving \`%s' dependencies..." "${_group_name}"\ && exp_pkg_dispatch_expand_packages "${_checkfl}" "${_forcefl}" "${_group_name}" "${_restart}" "${_reversefl}"\ && exp_pkg_dispatch_complete "${_dispatch_fn}" "${_group_name}" "${EX_PKG_DISABLED}" "${EX_PKG_FINISHED}"\ - && rtl_log_msg notice "Resolved \`%s' dependencies." "${_group_name}"\ + && rtl_log_msg verbose "Resolved \`%s' dependencies." "${_group_name}"\ && EXP_PKG_DISPATCH_COUNT_MAX="$(rtl_llength "${EX_PKG_NAMES}")"\ && [ "${EXP_PKG_DISPATCH_COUNT_MAX}" -gt 0 ]; then _pkg_names="$(rtl_lconcat "${_pkg_names}" "${EX_PKG_NAMES}")"; diff --git a/subr/pkg_fetch_download.subr b/subr/pkg_fetch_download.subr index 7a89454e..8a33783f 100644 --- a/subr/pkg_fetch_download.subr +++ b/subr/pkg_fetch_download.subr @@ -20,7 +20,7 @@ pkg_fetch_download_clean_dlcache() { done; if [ "${_skipfl}" -eq 0 ]; then _fname="${_dlcachedir}/${_pkg_name}/${_fname}"; - rtl_log_msg notice "Deleting redundant file \`%s' for package \`%s'." "${_fname}" "${_pkg_name}"; + rtl_log_msg verbose "Deleting redundant file \`%s' for package \`%s'." "${_fname}" "${_pkg_name}"; rtl_fileop rm "${_fname}"; fi; done; -- cgit v1.2.3