File: DummyIOHandle.pm

package info (click to toggle)
libcgi-application-plugin-logdispatch-perl 1.02-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 180 kB
  • sloc: perl: 454; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package DummyIOHandle;

# Very simple IO module that handles standard print statements, and 
# stores any printed statements in $self.
# This is used as a Handle that Log::Dispatch::Handle can use, giving
# us an in-memory buffer for collecting and testing log messages

sub new {
  my $class = shift;
  my $string = '';
  my $self = \$string;
  bless $self, $class;
  return $self;
}

sub print {
  my $self= shift;

  $$self .= join('', @_);
}

1;