Fancy output: prepend [info] blocks to log_action_msg calls.
authorDidier Raboud <odyx@debian.org>
Wed, 4 Apr 2012 12:45:43 +0000 (14:45 +0200)
committerDidier Raboud <odyx@debian.org>
Wed, 4 Apr 2012 12:57:30 +0000 (14:57 +0200)
Signed-off-by: Didier Raboud <odyx@debian.org>
debian/lsb-base.README.Debian
init-functions

index edf6b3f2ef6d7b752d055b9095677b657a1e31b5..750abbbbabe1c211d10beed4b01460b01a453c02 100644 (file)
@@ -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
index 91a79b48e7c0bf1c7dc00c4bb35f28cad3bb02ce..fbd0b894d444124a6aede45db2eaabb3fdddfefc 100644 (file)
@@ -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 "$@"
 }