Commit 29edb522 authored by Robert Ricci's avatar Robert Ricci

New library function: libtestbed::TBDebugTimeStamp()

Is controlled by a new configure variable called TIMESTAMPS - if this
variable is set, prints out a timestamp, along with its arguments (so
that you can distinguish between the timesteamps.) Otherwise, does
nothing. The basic idea is that we can sprinkle calls to this in the
code, and only enable it on devel trees.
parent cac0fafc
......@@ -833,6 +833,7 @@ fi
#
# Defaults for for above variables.
#
......@@ -1119,7 +1120,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1123: checking for a BSD compatible install" >&5
echo "configure:1124: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -1413,6 +1414,7 @@ s%@FSDIR_PROJ@%$FSDIR_PROJ%g
s%@FSDIR_GROUPS@%$FSDIR_GROUPS%g
s%@FSDIR_USERS@%$FSDIR_USERS%g
s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g
s%@TIMESTAMPS@%$TIMESTAMPS%g
s%@LEDA@%$LEDA%g
s%@ASSIGN@%$ASSIGN%g
s%@SSH_ARGS@%$SSH_ARGS%g
......
......@@ -37,6 +37,7 @@ AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS)
#
# Defaults for for above variables.
......
......@@ -8,10 +8,11 @@ use Exporter;
@ISA = "Exporter";
@EXPORT =
qw ( SENDMAIL OPENMAIL TBTimeStamp TBBackGround TBDateTimeFSSafe
TBMakeLogname TB_BOSSNODE TBGenSecretKey);
TBMakeLogname TB_BOSSNODE TBGenSecretKey TBDebugTimeStamp );
my $MAILTAG = "@OURDOMAIN@";
my $BOSSNODE = "@BOSSNODE@";
my $TIMESTAMPS = "@TIMESTAMPS@";
# Hostname of our boss node
sub TB_BOSSNODE() { $BOSSNODE; }
......@@ -125,6 +126,21 @@ sub TBDateTimeFSSafe()
return POSIX::strftime("20%y%m%d-%H.%M.%S", localtime());
}
#
# Print out a timestamp if the TIMESTAMPS configure variable was set.
#
# usage: void TBDebugTimeStamp(@)
#
sub TBDebugTimeStamp(@)
{
my @strings = @_;
if ($TIMESTAMPS) {
print "TIMESTAMP: ", TBTimeStamp(), " ", join("",@strings), "\n";
}
}
#
# Put ourselves into the background, directing output to the log file.
# The caller provides the logfile name, which should have been created
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment