From 090275b0e6cbee05c5a82d67813ba488156b2df7 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 4 Apr 2012 14:45:43 +0200 Subject: [PATCH] Fancy output: prepend [info] blocks to log_action_msg calls. Signed-off-by: Didier Raboud --- debian/lsb-base.README.Debian | 2 ++ init-functions | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/debian/lsb-base.README.Debian b/debian/lsb-base.README.Debian index edf6b3f..750abbb 100644 --- a/debian/lsb-base.README.Debian +++ b/debian/lsb-base.README.Debian @@ -173,6 +173,8 @@ log_daemon_msg_pre log_daemon_msg_post log_begin_msg_pre (since 4.1+Debian0+fancy0) log_begin_msg_post (since 4.1+Debian0+fancy0) +log_action_msg_pre (since 4.1+Debian0+fancy0+) +log_action_msg_post (since 4.1+Debian0+fancy0+) log_action_begin_msg_pre (since 4.1+Debian0+fancy0) log_action_begin_msg_post (since 4.1+Debian0+fancy0) log_end_msg_pre diff --git a/init-functions b/init-functions index 91a79b4..fbd0b89 100644 --- a/init-functions +++ b/init-functions @@ -356,7 +356,9 @@ log_end_msg () { } log_action_msg () { + log_action_msg_pre "$@" echo "$@." + log_action_msg_post "$@" } log_action_begin_msg () { @@ -425,6 +427,14 @@ log_end_msg_pre () { fi } log_end_msg_post () { :; } +log_action_msg_pre () { + if log_use_fancy_output; then + CYAN=$( $TPUT setaf 6) + NORMAL=$( $TPUT op) + /bin/echo -ne "[${CYAN}info${NORMAL}] " + fi +} +log_action_msg_post () { :; } log_action_begin_msg_pre () { log_daemon_msg_pre "$@" } -- 2.30.2