New
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Web.pm
1 # $Id: Web.pm,v 1.1 2006-09-26 09:31:10 mike Exp $
2
3 package ZOOM::IRSpy::Web;
4
5 use 5.008;
6 use strict;
7 use warnings;
8
9 use ZOOM::IRSpy;
10 our @ISA = qw(ZOOM::IRSpy);
11
12 use ZOOM::IRSpy::Record qw(xml_encode);
13
14 =head1 NAME
15
16 ZOOM::IRSpy::Web - subclass of ZOOM::IRSpy for use by Web UI
17
18 =head1 DESCRIPTION
19
20 This behaves exactly the same as the base C<ZOOM::IRSpy> class except
21 that the Clog()> method does not call YAZ log, but outputs
22 HTML-formatted messages on standard output.
23
24 =cut
25
26 sub log {
27     my $this = shift();
28     my($level, @s) = @_;
29
30     # We should only produce output if $level is turned on
31     my $message = "[$level] " . join("", @s);
32     $| = 1;                     # 
33     print xml_encode($message), "<br/>\n";
34 }
35
36
37 =head1 SEE ALSO
38
39 ZOOM::IRSpy
40
41 =head1 AUTHOR
42
43 Mike Taylor, E<lt>mike@indexdata.comE<gt>
44
45 =head1 COPYRIGHT AND LICENSE
46
47 Copyright (C) 2006 by Index Data ApS.
48
49 This library is free software; you can redistribute it and/or modify
50 it under the same terms as Perl itself, either Perl version 5.8.7 or,
51 at your option, any later version of Perl 5 you may have available.
52
53 =cut
54
55 1;