Curie/Log/Any/Adapter/LogWindow.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use Renard::Incunabula::Common::Setup;
2 package Renard::Curie::Log::Any::Adapter::LogWindow;
3 # ABSTRACT: Log::Any adapter that directs messages to the log window component
4 $Renard::Curie::Log::Any::Adapter::LogWindow::VERSION = '0.005';
5 # These methods are generated for all Log::Any adapters
6  
7 use Moo;
8  
9 use Renard::Incunabula::Common::Types qw(InstanceOf);
10 use Log::Any::Adapter::Util ();
11  
12 extends 'Log::Any::Adapter::Base';
13  
14 has log_window => (
15 is => 'ro',
16 isa => InstanceOf['Renard::Curie::Component::LogWindow'],
17 #required => 1,
18 );
19  
20 # Create logging methods: debug, info, etc.
21 foreach my $method ( Log::Any::Adapter::Util::logging_methods() ) {
22 no strict 'refs'; ## no critic : we are creating methods
23 *$method = sub {
24 my $self = shift;
25 $self->log_window->log( category => $self->{category}, level => $method, message => $_[0] );
26 };
27 }
28  
29 # Create detection methods: is_debug, is_info, etc.
30 foreach my $method ( Log::Any::Adapter::Util::detection_methods() ) {
31 no strict 'refs'; ## no critic : we are creating methods
32 *$method = sub { 1 };
33 }
34  
35 1;
36  
37 __END__