# #
# Log to a directory. #
# #
################################################################################
proc log_init_directory { directory } {
global fm_logfile
set fm_logfile "$directory/ExpectLogs.txt"
exp_internal -f $directory/ExpectDiag.txt 0
}
################################################################################
# #
# Temp hack. #
# #
################################################################################
proc log_init_custom { logfile } {
global fm_logfile
global g_module_name
global g_test_results_base_dir
#
# Cache the module name.
#
set g_module_name $logfile
#
# Figure out the logfile path.
#
test_results_set_base_dir
#
# Set it.
#
set fm_logfile "$g_test_results_base_dir/Logfile.txt"
}
################################################################################
# #
# Capture a log message with a nice time stamp. #
# #
################################################################################
proc ft_log { message } {
global fm_logfile
set date_val [ timestamp -format "%m/%d: %X: " ]
log_file $fm_logfile
send_log -- "$date_val $message\n"
log_file
send_user -- "$date_val $message\n"
}
################################################################################
# #
# Bail on a critical error. #
# #
################################################################################
proc ft_error { message } {
ft_log "ERROR: $message"
puts "\n\nERROR: $message"
exit
}
################################################################################
# #
# Code from source : support/include/AMM.exp #
# #
################################################################################
################################################################################
# #
86 IBM BladeCenter HX5 Type 7873, 7872, 1910, and 1909: Installation and User's Guide