projects
/
monkeysphere.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
948b217
)
Finalize new log level changes. This is more or less doing what it should. The...
author
Jameson Graef Rollins
<jrollins@phys.columbia.edu>
Tue, 2 Sep 2008 07:38:27 +0000
(
00:38
-0700)
committer
Jameson Graef Rollins
<jrollins@phys.columbia.edu>
Tue, 2 Sep 2008 07:38:27 +0000
(
00:38
-0700)
debian/changelog
patch
|
blob
|
history
etc/monkeysphere-server.conf
patch
|
blob
|
history
etc/monkeysphere.conf
patch
|
blob
|
history
man/man1/monkeysphere-ssh-proxycommand.1
patch
|
blob
|
history
man/man1/monkeysphere.1
patch
|
blob
|
history
man/man8/monkeysphere-server.8
patch
|
blob
|
history
src/common
patch
|
blob
|
history
src/monkeysphere-server
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index 76e4d0432dfef752754b0581c5c70eb5041e2814..1cc1dd8e70b5e25e9f9ef36c6dc0454b58361195 100644
(file)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-1,10
+1,10
@@
monkeysphere (0.12-1) UNRELEASED; urgency=low
monkeysphere (0.12-1) UNRELEASED; urgency=low
- * Improved output handling.
+ * Improved output handling.
New LOG_LEVEL variable.
* debian/control: switched Homepage: and Vcs-Git: to canonicalized
upstream hostnames.
* debian/control: switched Homepage: and Vcs-Git: to canonicalized
upstream hostnames.
- -- Jameson Graef Rollins <jrollins@phys.columbia.edu>
Sun, 24 Aug 2008 23:49:23
-0700
+ -- Jameson Graef Rollins <jrollins@phys.columbia.edu>
Mon, 01 Sep 2008 23:55:56
-0700
monkeysphere (0.11-1) experimental; urgency=low
monkeysphere (0.11-1) experimental; urgency=low
diff --git
a/etc/monkeysphere-server.conf
b/etc/monkeysphere-server.conf
index 15f43b1aeb2f5f0ea0f0d3115f76ae558d1308bb..1b0ed9f96919313b7c8fbd48f172926d65028bb6 100644
(file)
--- a/
etc/monkeysphere-server.conf
+++ b/
etc/monkeysphere-server.conf
@@
-6,6
+6,10
@@
# prefeced by "MONKEYSPHERE_" will take precedence over the values
# specified here.
# prefeced by "MONKEYSPHERE_" will take precedence over the values
# specified here.
+# Log level. Can be SILENT, ERROR, INFO, DEBUG, in increasing order
+# of verbosity.
+#LOG_LEVEL=INFO
+
# GPG keyserver to search for keys.
#KEYSERVER=subkeys.pgp.net
# GPG keyserver to search for keys.
#KEYSERVER=subkeys.pgp.net
diff --git
a/etc/monkeysphere.conf
b/etc/monkeysphere.conf
index 2648fa963d2d28f4da0e5d792c5e9b2cc057a814..d9bbad34a7fff598db0b44ce7500eb6366ad3d97 100644
(file)
--- a/
etc/monkeysphere.conf
+++ b/
etc/monkeysphere.conf
@@
-6,6
+6,10
@@
# prefeced by "MONKEYSPHERE_" will take precedence over the values
# specified here.
# prefeced by "MONKEYSPHERE_" will take precedence over the values
# specified here.
+# Log level. Can be SILENT, ERROR, INFO, DEBUG, in increasing order
+# of verbosity.
+#LOG_LEVEL=INFO
+
# GPG home directory. If not specified either here or in the
# MONKEYSPHERE_GNUPGHOME environment variable, then the value of the
# GNUPGHOME environment variable will be used. If GNUPGHOME is not
# GPG home directory. If not specified either here or in the
# MONKEYSPHERE_GNUPGHOME environment variable, then the value of the
# GNUPGHOME environment variable will be used. If GNUPGHOME is not
diff --git
a/man/man1/monkeysphere-ssh-proxycommand.1
b/man/man1/monkeysphere-ssh-proxycommand.1
index 9aad23205de7a01161c4941449f0ba2c02f56232..c3c7993152857dd1e4936b17e0ce72a46c9433bb 100644
(file)
--- a/
man/man1/monkeysphere-ssh-proxycommand.1
+++ b/
man/man1/monkeysphere-ssh-proxycommand.1
@@
-54,6
+54,11
@@
will be properly checked.
All environment variables defined in monkeysphere(1) can also be used
for the proxy command, with one note:
All environment variables defined in monkeysphere(1) can also be used
for the proxy command, with one note:
+.TP
+MONKEYSPHERE_LOG_LEVEL
+Set the log level. Can be SILENT, ERROR, INFO, DEBUG, in increasing
+order of verbosity.
+
.TP
MONKEYSPHERE_CHECK_KEYSERVER
Setting this variable (to `true' or `false') will override the policy
.TP
MONKEYSPHERE_CHECK_KEYSERVER
Setting this variable (to `true' or `false') will override the policy
diff --git
a/man/man1/monkeysphere.1
b/man/man1/monkeysphere.1
index 92ba2fa076512043c404495c37d73b53802f84e7..26327f4f0fe51c8648a5c05a9951315aee3ed2c7 100644
(file)
--- a/
man/man1/monkeysphere.1
+++ b/
man/man1/monkeysphere.1
@@
-83,6
+83,10
@@
Output a brief usage summary. `h' or `?' may be used in place of
The following environment variables will override those specified in
the monkeysphere.conf configuration file (defaults in parentheses):
.TP
The following environment variables will override those specified in
the monkeysphere.conf configuration file (defaults in parentheses):
.TP
+MONKEYSPHERE_LOG_LEVEL
+Set the log level. Can be SILENT, ERROR, INFO, DEBUG, in increasing
+order of verbosity.
+.TP
MONKEYSPHERE_GNUPGHOME, GNUPGHOME
GnuPG home directory (~/.gnupg).
.TP
MONKEYSPHERE_GNUPGHOME, GNUPGHOME
GnuPG home directory (~/.gnupg).
.TP
diff --git
a/man/man8/monkeysphere-server.8
b/man/man8/monkeysphere-server.8
index 5985f2412f0835cdd1d33c63450f68eb910b42c4..b63f65957bcacf33d6c78f90fea1b6799797f44f 100644
(file)
--- a/
man/man8/monkeysphere-server.8
+++ b/
man/man8/monkeysphere-server.8
@@
-182,6
+182,10
@@
The following environment variables will override those specified in
the monkeysphere-server.conf configuration file (defaults in
parentheses):
.TP
the monkeysphere-server.conf configuration file (defaults in
parentheses):
.TP
+MONKEYSPHERE_LOG_LEVEL
+Set the log level. Can be SILENT, ERROR, INFO, DEBUG, in increasing
+order of verbosity.
+.TP
MONKEYSPHERE_KEYSERVER
OpenPGP keyserver to use (subkeys.pgp.net).
.TP
MONKEYSPHERE_KEYSERVER
OpenPGP keyserver to use (subkeys.pgp.net).
.TP
diff --git
a/src/common
b/src/common
index 34d9b5adfcace1cf8cf4858788a03d602ade4e4a..f93793e65958768ab7e7dc3d3848339803d41ba3 100644
(file)
--- a/
src/common
+++ b/
src/common
@@
-26,15
+26,40
@@
failure() {
exit ${2:-'255'}
}
exit ${2:-'255'}
}
-# write output to stderr
+# write output to stderr based on specified LOG_LEVEL the first
+# parameter is the priority of the output, and everything else is what
+# is echoed to stderr
log() {
log() {
+ local priority
local level
local level
+ local output
- level="$1"
+ # translate lowers to uppers in global log level
+ LOG_LEVEL=$(echo "$LOG_LEVEL" | tr "[:lower:]" "[:upper:]")
+
+ # just go ahead and return if the log level is silent
+ if [ "$LOG_LEVEL" = 'SILENT' ] ; then
+ return
+ fi
+
+ # get priority from first parameter, translating all lower to
+ # uppers
+ priority=$(echo "$1" | tr "[:lower:]" "[:upper:]")
shift
shift
- echo -n "ms: " >&2
- echo "$@" >&2
+ # scan over available levels
+ # list in decreasing verbosity (all caps)
+ for level in DEBUG INFO ERROR ; do
+ # output if the log level matches, set output to true
+ # this will output for all subsequenty loops as well.
+ if [ "$LOG_LEVEL" = "$level" ] ; then
+ output=true
+ fi
+ if [ "$priority" = "$level" -a "$output" = 'true' ] ; then
+ echo -n "ms: " >&2
+ echo "$@" >&2
+ fi
+ done
}
# cut out all comments(#) and blank lines from standard input
}
# cut out all comments(#) and blank lines from standard input
diff --git
a/src/monkeysphere-server
b/src/monkeysphere-server
index c81c066f167e5a2b7e10db131aede4a7a6798737..e3ffc4b13878023fb267eba1fc86e2e0fefcdfff 100755
(executable)
--- a/
src/monkeysphere-server
+++ b/
src/monkeysphere-server
@@
-855,7
+855,7
@@
unset MONKEYSPHERE_USER
# set empty config variable with ones from the environment, or with
# defaults
# set empty config variable with ones from the environment, or with
# defaults
-LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=${LOG_LEVEL:="
info
"}}
+LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=${LOG_LEVEL:="
INFO
"}}
KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="subkeys.pgp.net"}}
AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:=${AUTHORIZED_USER_IDS:="%h/.config/monkeysphere/authorized_user_ids"}}
RAW_AUTHORIZED_KEYS=${MONKEYSPHERE_RAW_AUTHORIZED_KEYS:=${RAW_AUTHORIZED_KEYS:="%h/.ssh/authorized_keys"}}
KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="subkeys.pgp.net"}}
AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:=${AUTHORIZED_USER_IDS:="%h/.config/monkeysphere/authorized_user_ids"}}
RAW_AUTHORIZED_KEYS=${MONKEYSPHERE_RAW_AUTHORIZED_KEYS:=${RAW_AUTHORIZED_KEYS:="%h/.ssh/authorized_keys"}}