X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDBase%2FLog.pm;fp=Debbugs%2FDBase%2FLog.pm;h=0000000000000000000000000000000000000000;hb=53c435119200ab9b1c2538a96b8374c51a078855;hp=3e493b72dc970c012e04cd034ea943adf6bee1d7;hpb=0e8f07fda6e40b5967d9c6b28b3200db22766343;p=debbugs.git diff --git a/Debbugs/DBase/Log.pm b/Debbugs/DBase/Log.pm deleted file mode 100644 index 3e493b7..0000000 --- a/Debbugs/DBase/Log.pm +++ /dev/null @@ -1,75 +0,0 @@ -# TODO: Implement 'stale' checks, so that there is no need to explicitly -# write out a record, before closing. - -package Debbugs::DBase::Log; - -use strict; - -sub new -{ - my $self = {}; -# $self->{LOG} = new FileHandle; -# $self->{AGE} = undef; -# $self->{PEERS} = []; - $self->{log} = []; - bless ($self); - return $self; -} -my %logClass = (); -my %logType = (); -sub Register -{ - my ($char, $type, $class) = (shift, shift, shift); - $logClass{ $char } = $class; - $logType{ $char } = $type; - -} - -sub Load -{ - my ($self, $handle) = (shift, shift); - foreach (keys %$self) { -print "key=$_\n"; -} - while (<$handle>) { - chomp; - my ($char, $class, $type) = ($_, $logClass{ $_ }, $logType{ $_ }); - my $msg = ""; - while (<$handle>) { - chomp; - if ( $_ eq "\3" ) { - last; - } else { - $msg .= "$_\n"; - } - } - if( defined($class) ) { - print "found handler $type for $char\n"; - my $log = $class->new($msg); - - my @log = $self->{log}; - push @log, ($log); - } else { - print "undefined handler for $char\n"; - } - } -} - -BEGIN { - use Exporter (); - use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - - # set the version for version checking - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(new); - %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], - - # your exported package globals go here, - # as well as any optionally exported functions - @EXPORT_OK = qw(); - -} - -1;