lilalo

diff lm-report @ 18:06260270cbe0

Добавлена функция, которая выдаёт результаты
обработки в виде XML.
!!!Недоделан quoting спец.символов XML
author devi
date Sun Sep 11 22:56:04 2005 +0300 (2005-09-11)
parents 6932824b39c1
children e2f1de29a491
line diff
     1.1 --- a/lm-report	Mon Jun 06 14:22:32 2005 +0300
     1.2 +++ b/lm-report	Sun Sep 11 22:56:04 2005 +0300
     1.3 @@ -412,7 +412,7 @@
     1.4  			}
     1.5  			$last_output_length+=length($_);
     1.6  			#if (!$cl{"suppress_output"} || $last_output_length < 5000) {
     1.7 -			if ($last_output_length < 5000) {
     1.8 +			if ($last_output_length < 50000) {
     1.9  				#print "(",length($_),")" if (length($_) > 2000) ;
    1.10  				$vt->process("$_"."\n") 
    1.11  			}
    1.12 @@ -943,6 +943,66 @@
    1.13  	close(CONFIG);
    1.14  }
    1.15  
    1.16 +
    1.17 +sub print_command_lines2
    1.18 +{
    1.19 +	my $output_filename=$_[0];
    1.20 +	open(OUT, ">", $output_filename)
    1.21 +		or die "Can't open $output_filename for writing\n";
    1.22 +
    1.23 +
    1.24 +	print OUT <<OUT;
    1.25 +<log>
    1.26 +OUT
    1.27 +
    1.28 +	my $cl;
    1.29 +	for my $i (@Command_Lines_Index) {
    1.30 +
    1.31 +		
    1.32 +		$cl = $Command_Lines[$i];
    1.33 +
    1.34 +
    1.35 +# Printing out
    1.36 +		print OUT <<OUT;
    1.37 +	<command>
    1.38 +		<day>$cl->{day}</day>
    1.39 +		<hour>$cl->{hour}</hour>
    1.40 +		<min>$cl->{min}</min>
    1.41 +		<sec>$cl->{sec}</sec>
    1.42 +		<tty>$cl->{tty}</tty>
    1.43 +		<uid>$cl->{uid}</uid>
    1.44 +		<euid>$cl->{euid}</euid>
    1.45 +		<prompt>$cl->{prompt}</prompt>
    1.46 +		<cline>$cl->{cline}</cline>
    1.47 +		<status>$cl->{err}</cline>
    1.48 +		<output>
    1.49 +$cl->{output}</output>
    1.50 +	</command>
    1.51 +OUT
    1.52 +	}
    1.53 +
    1.54 +	for my $diff (@Diffs) {
    1.55 +
    1.56 +		print OUT <<OUT;
    1.57 +	<diff>
    1.58 +		<path>$diff->{path}</path>
    1.59 +		<uid>$diff->{uid}</uid>
    1.60 +		<day>$diff->{day}</day>
    1.61 +		<hour>$diff->{hour}</hour>
    1.62 +		<min>$diff->{min}</min>
    1.63 +		<sec>$diff->{sec}</sec>
    1.64 +		<text>
    1.65 +$diff->{text}</text>
    1.66 +	</diff>
    1.67 +OUT
    1.68 +	}
    1.69 +
    1.70 +	print OUT <<OUT;
    1.71 +</log>
    1.72 +OUT
    1.73 +}
    1.74 +
    1.75 +
    1.76  $| = 1;
    1.77  
    1.78  my %file_config;