Debian Codegraph @

lib/Dancer2/Logger/Diag.pm

raw
1 package Dancer2::Logger::Diag;
2 # ABSTRACT: Test::More diag() logging engine for Dancer2
3 $Dancer2::Logger::Diag::VERSION = '2.2.2';
4 use Moo;
5 use Test::More;
6
7 with 'Dancer2::Core::Role::Logger';
8
9 sub log {
10 my ( $self, $level, $message ) = @_;
11
12 Test::More::diag( $self->format_message( $level => $message ) );
13 }
14
15 1;
16
17 __END__
18
19 =pod
20
21 =encoding UTF-8
22
23 =head1 NAME
24
25 Dancer2::Logger::Diag - Test::More diag() logging engine for Dancer2
26
27 =head1 VERSION
28
29 version 2.2.2
30
31 =head1 DESCRIPTION
32
33 This logging engine uses L<Test::More>'s diag() to output as TAP comments.
34
35 This is very useful in case you're writing a test and want to have logging
36 messages as part of your TAP.
37
38 =head1 METHODS
39
40 =head2 log
41
42 Use Test::More's diag() to output the log message.
43
44 =head1 AUTHOR
45
46 Dancer Core Developers
47
48 =head1 COPYRIGHT AND LICENSE
49
50 This software is copyright (c) 2026 by Alexis Sukrieh.
51
52 This is free software; you can redistribute it and/or modify it under
53 the same terms as the Perl 5 programming language system itself.
54
55 =cut