| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WWW::Slides::BasicLogger; | 
| 2 |  |  |  |  |  |  | { | 
| 3 | 6 |  |  | 6 |  | 42376 | use version; our $VERSION = qv('0.0.5'); | 
|  | 6 |  |  |  |  | 13202 |  | 
|  | 6 |  |  |  |  | 36 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 6 |  |  | 6 |  | 563 | use warnings; | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 179 |  | 
| 6 | 6 |  |  | 6 |  | 28 | use strict; | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 159 |  | 
| 7 | 6 |  |  | 6 |  | 31 | use Carp; | 
|  | 6 |  |  |  |  | 12 |  | 
|  | 6 |  |  |  |  | 475 |  | 
| 8 | 6 |  |  | 6 |  | 2588 | use IO::Handle; | 
|  | 6 |  |  |  |  | 18739 |  | 
|  | 6 |  |  |  |  | 279 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 6 |  |  | 6 |  | 6967 | use Object::InsideOut; | 
|  | 6 |  |  |  |  | 301643 |  | 
|  | 6 |  |  |  |  | 42 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | # Other recommended modules (uncomment to use): | 
| 13 |  |  |  |  |  |  | #  use IO::Prompt; | 
| 14 |  |  |  |  |  |  | #  use Perl6::Export; | 
| 15 |  |  |  |  |  |  | #  use Perl6::Slurp; | 
| 16 |  |  |  |  |  |  | #  use Perl6::Say; | 
| 17 |  |  |  |  |  |  | #  use Regexp::Autoflags; | 
| 18 |  |  |  |  |  |  | #  use Readonly; | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | # Module implementation here | 
| 21 |  |  |  |  |  |  | my @channel : Field    # Where the logging will be sent | 
| 22 |  |  |  |  |  |  | : Std(Name => 'channel', Private => 1) : Get(Name => 'channel') | 
| 23 |  |  |  |  |  |  | : Arg(Name => 'channel', Default => \*STDERR); | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | my %init_args : InitArgs = ('fake' => '',); | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | sub _init : Init { | 
| 28 | 6 |  |  |  |  | 15285 | my $self = shift; | 
| 29 | 6 |  |  |  |  | 14 | my ($args) = @_; | 
| 30 | 6 | 100 |  |  |  | 106 | $self->set_channel(undef) if $args->{fake}; | 
| 31 | 6 |  |  | 6 |  | 1038 | } | 
|  | 6 |  |  |  |  | 12 |  | 
|  | 6 |  |  |  |  | 74 |  | 
| 32 |  |  |  |  |  |  | sub print : Private { | 
| 33 | 20 |  |  |  |  | 189 | my $self = shift; | 
| 34 | 20 | 100 |  |  |  | 553 | if (my $channel = $self->channel()) { | 
| 35 | 10 |  |  |  |  | 100 | $channel->print(@_, "\n"); | 
| 36 |  |  |  |  |  |  | } | 
| 37 | 20 |  |  |  |  | 611 | return; | 
| 38 | 6 |  |  | 6 |  | 1579 | } | 
|  | 6 |  |  |  |  | 10 |  | 
|  | 6 |  |  |  |  | 28 |  | 
| 39 | 4 |  |  | 4 | 0 | 7665 | sub debug { shift->print(@_); } | 
| 40 | 4 |  |  | 4 | 0 | 6650 | sub info  { shift->print(@_); } | 
| 41 | 4 |  |  | 4 | 0 | 5893 | sub warn  { shift->print(@_); } | 
| 42 | 4 |  |  | 4 | 1 | 5684 | sub error { shift->print(@_); } | 
| 43 | 4 |  |  | 4 | 0 | 5591 | sub fatal { shift->print(@_); } | 
| 44 |  |  |  |  |  |  | } | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | 1;    # Magic true value required at end of module | 
| 47 |  |  |  |  |  |  | __END__ |