Saturday, June 21
8 AM to 1 PM
574 Saugatucket Rd
Peace Dale, RI
#!/bin/bash . logger.sh info starting .... info finished #ENDwhere logger.sh is somewhere in your path and has the content
#!/bin/bash
# logger.sh
#
# info, warning, error and fatal functions to display timestamped
# messages to stderr. Use the infof, warningf, errorf and fatalf
# functions to format the message using printf. A newline is
# automatically added and should not be included in your printf
# format string.
function info {
log INFO $*
}
function infof {
logf INFO $*
}
function warning {
log WARNING $*
}
function warningf {
logf WARNING $*
}
function error {
log ERROR $*
}
function errorf {
logf ERROR $*
}
function fatal {
log FATAL $*
exit 1;
}
function fatalf {
logf FATAL $*
exit 1;
}
function log {
echo $(date +'%F %T') $* 1>&2
}
function logf {
level=$1
format=$2
shift 2
printf "$(date +'%F %T') $level $format\n" $* 1>&2
}
# END
Most other languages have extensive logging support.
I listened to some of How the States Got Their Shapes on the drive today. I was fascinated by the history of West Virginia -- a state that exists because of Civil War opportunism. How physical borders are negotiated is a great segue into how other kinds of borders are negotiated in families, sects, corporations, etc. Great source of projects for a high school, eg "Why is South Kingstown the shape it is?" or "Why does the Chariho school district exist?".