Closed GoogleCodeExporter closed 9 years ago
I'd be very surprised if existing Unix/Cygwin facilities such as I/O
redirection,
tee, screen, and just passing an input file to the shell couldn't already do
what you
need. As far as I can tell, rxvt or xterm don't support log files either.
(Having the log file support in PuTTY makes sense because it's a standalone
solution.)
Original comment by andy.koppe
on 27 Mar 2009 at 9:55
Actually, xterm does support logging if it's been compiled in, so --log shall
go in
after all.
Original comment by andy.koppe
on 28 Mar 2009 at 7:37
Original comment by andy.koppe
on 28 Mar 2009 at 7:38
Implemented --log option in r221 on trunk.
Original comment by andy.koppe
on 28 Mar 2009 at 11:12
Original comment by andy.koppe
on 7 Jun 2009 at 8:02
Thanks a lot. This will be really useful! :-)
P.S.- Sorry for the long delay on answering. I was on a looong vacation :-)
Original comment by aemc...@yahoo.com
on 17 Aug 2009 at 10:52
You're welcome. Btw, I recently stumbled across the 'script' utility in Cygwin's
'util-linux' package, which provides an easy way to log the output of any
command.
Unlike minTTY's logging facility, it has the ability to append to an existing
log
file. And it puts timestamps at the start of end of the log, which might come
in handy.
With minTTY, it can be used like this:
mintty script -c 'bash -l' logfile
Original comment by andy.koppe
on 5 Sep 2009 at 2:41
Issue 9 has been merged into this issue.
Original comment by andy.koppe
on 5 Sep 2009 at 2:44
Notes:
======
1) Replace "username" in LOGDIR below with actual username or change to whatever
location you prefer. Please make sure the directories for LOGDIR and TIMDIR
already
exist.
2) playsession script can be past a session Logfile name (without the extension)
and a Speed up Factor (Divisor) after the Logfile name.
3) If you are using .bash_profile to change/modify any enviornment varialbles
please do so before calling .bashrc otherwise they will not be available in
the nested Shell which gets logged.
4) You will have to logout twice (i.e. exit twice) to close the Cygwin Terminal.
###############################################################################
#Create a ".logrc" file in your home directory with the following lines in it
# File to store location of Session Logs and Timing Files
LOGDIR="/cygdrive/c/Users/username/Documents/Cygwin Terminal Logs/"
TIMDIR="$LOGDIR""Timing Files/"
LOGFILE="Session-$(date +%Y%m%d-%H%M%S-%N)"
###############################################################################
#Create a "bin/logsession" file in your home directory with the following lines
#in it and make the file executable.
#!/bin/bash
#File to initiate the session logging to a log file
if [ -f "${HOME}/.logrc" ] ; then
source "${HOME}/.logrc"
#
# Check if user initiated request for session logging and start the logging file
#
if [ $0 == "${HOME}/bin/logsession" ] ; then
/usr/bin/script --timing="$TIMDIR""$LOGFILE.tm" "$LOGDIR""$LOGFILE.log"
#
# Session logging not initiated by user (i.e. initiated by .bashrc)
# Check if this is topmost SHELL (to avoid recursive loop) and start logging
file
#
elif [ $SHLVL == 1 ] ; then
/usr/bin/script --timing="$TIMDIR""$LOGFILE.tm" "$LOGDIR""$LOGFILE.log"
fi
fi
###############################################################################
#Create a "bin/playsession" file in your home directory with the following lines
#in it and make the file executable.
#!/bin/bash
if [ -f "${HOME}/.logrc" ] ; then
source "${HOME}/.logrc"
#
# Check if user passed a speedup factor
#
if [[ $2 ]] ; then
echo
echo "********** Starting playsession for $1 at $2X Speed **********"
echo
/usr/bin/scriptreplay --timing="$TIMDIR""$1.tm" "$LOGDIR""$1.log" "$2"
echo
echo "********** Finished playsession for $1 at $2X Speed **********"
echo
#
# No speedup factor
#
else
echo
echo "********** Starting playsession for $1 **********"
echo
/usr/bin/scriptreplay --timing="$TIMDIR""$1.tm" "$LOGDIR""$1.log"
echo
echo "********** Finished playsession for $1 **********"
echo
fi
fi
###############################################################################
#Add the following lines at the end of your ".bashrc" file in your home
directory.
# Log all the session output to a log file
if [ -f "${HOME}/bin/logsession" ] ; then
source "${HOME}/bin/logsession"
fi
Original comment by anuragko...@gmail.com
on 11 Feb 2013 at 11:41
Attachments:
Original issue reported on code.google.com by
aemc...@yahoo.com
on 27 Mar 2009 at 11:36