#######################################################################
# This software has been created by Genome Research Limited (GRL).    # 
# GRL hereby grants permission to use, copy, modify and distribute    # 
# this software and its documentation for non-commercial purposes     # 
# without fee at the user's own risk on the basis set out below.      #
# GRL neither undertakes nor accepts any duty whether contractual or  # 
# otherwise in connection with the software, its use or the use of    # 
# any derivative, and makes no representations or warranties, express #
# or implied, concerning the software, its suitability, fitness for   #
# a particular purpose or non-infringement.                           #
# In no event shall the authors of the software or GRL be responsible # 
# or liable for any loss or damage whatsoever arising in any way      # 
# directly or indirectly out of the use of this software or its       # 
# derivatives, even if advised of the possibility of such damage.     #
# Our software can be freely distributed under the conditions set out # 
# above, and must contain this copyright notice.                      #
#######################################################################
#
# $Id: Log.pm,v 1.6 1999/08/13 12:25:38 bt1 Exp $
#
sub writeToBadgerLog {
	my ($sec, $min, $hour, $mday, $mon, $year, $wday)=(localtime(time))[0..6];

	my $oldumask = umask();
	umask(000);
	my $date = sprintf("%02d_%02d_%04d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec);
	my $user = [getpwnam([getpwuid($>)]->[0])]->[0];
	my $program = $0 ;
	$program =~ s#.*/##;
	open(LOG,">>/nfs/disk54/badger/logs/$program.log") or warn "$program : Unable to write log for usage : $!\n";
	print LOG "$user is using $program on $date\n";
	close(LOG);
	umask($oldumask);
}
1;
#
# $Log: Log.pm,v $
# Revision 1.6  1999/08/13 12:25:38  bt1
# added 1 to month
#
# Revision 1.5  1999/06/17 14:47:50  as1
# Added umasking
#
# Revision 1.4  1999/06/16 13:40:51  bt1
# Added hour,min,sec to time
# ,.
#
# Revision 1.3  1999/06/16 13:30:26  bt1
# Strip off slashes from program name - as1
# .,
#
# Revision 1.2  1999/06/16 13:16:48  as1
# Added 1900 to date and $! to error message
#
# Revision 1.1  1999/06/09 11:58:14  as1
# Initial revision
#
#
