fix to logging to prefix all log output with log prefix, and allow changing of log...
authorJameson Graef Rollins <jrollins@finestructure.net>
Tue, 3 Mar 2009 16:56:00 +0000 (11:56 -0500)
committerJameson Graef Rollins <jrollins@finestructure.net>
Tue, 3 Mar 2009 16:56:00 +0000 (11:56 -0500)
src/monkeysphere
src/monkeysphere-authentication
src/monkeysphere-host
src/share/common

index 8d59d08870727d99f07784241470d838c8d50f2f..f721108ef5e9d59688566d0dd1a539cb5853823f 100755 (executable)
@@ -182,6 +182,7 @@ AUTHORIZED_KEYS=${MONKEYSPHERE_AUTHORIZED_KEYS:=$AUTHORIZED_KEYS}
 AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:="${MONKEYSPHERE_HOME}/authorized_user_ids"}
 REQUIRED_HOST_KEY_CAPABILITY=${MONKEYSPHERE_REQUIRED_HOST_KEY_CAPABILITY:="a"}
 REQUIRED_USER_KEY_CAPABILITY=${MONKEYSPHERE_REQUIRED_USER_KEY_CAPABILITY:="a"}
+LOG_PREFIX=${MONKEYSPHERE_LOG_PREFIX:='ms: '}
 
 # export GNUPGHOME and make sure gpg home exists with proper
 # permissions
index b0dcc88fd85b70a38ed44f52d07b346e3c2a9ffc..85ff04fc5ddd31b74c0c776530ee4f043afb53d6 100755 (executable)
@@ -129,6 +129,7 @@ REQUIRED_USER_KEY_CAPABILITY=${MONKEYSPHERE_REQUIRED_USER_KEY_CAPABILITY:="a"}
 GNUPGHOME_CORE=${MONKEYSPHERE_GNUPGHOME_CORE:="${MADATADIR}/core"}
 GNUPGHOME_SPHERE=${MONKEYSPHERE_GNUPGHOME_SPHERE:="${MADATADIR}/sphere"}
 CORE_KEYLENGTH=${MONKEYSPHERE_CORE_KEYLENGTH:="2048"}
+LOG_PREFIX=${MONKEYSPHERE_LOG_PREFIX:='ms: '}
 
 # export variables needed in su invocation
 export DATE
index 7fb3980109386356b1b7c6604c00294a4cca5884..b052ca1b0d12bcb0f5183d3ecb15afbc34ef2c40 100755 (executable)
@@ -230,6 +230,7 @@ PROMPT=${MONKEYSPHERE_PROMPT:=$PROMPT}
 
 # other variables
 GNUPGHOME_HOST=${MONKEYSPHERE_GNUPGHOME_HOST:="${MHDATADIR}"}
+LOG_PREFIX=${MONKEYSPHERE_LOG_PREFIX:='ms: '}
 
 # export variables needed in su invocation
 export DATE
index 83120d120c785e11cf9ab291852eea3eafe0db84..ea872ba17abe39ec1a8a721876b6bf74d42ab069 100644 (file)
@@ -76,11 +76,10 @@ log() {
        fi
        if [ "$priority" = "$level" -a "$output" = 'true' ] ; then
            if [ "$1" ] ; then
-               echo -n "ms: " >&2
-               echo "$@" >&2
+               echo "$@"
            else
-               cat >&2
-           fi
+               cat
+           fi | sed 's/^/'"${LOG_PREFIX}"'/' >&2
        fi
     done
 }