blib/lib/Game/TextMapper/Log.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 88.8% 8 / 9 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
get
1.0
CRAP 1.0
« script/text-mapper ↑ Summary blib/lib/Game/TextMapper/Mapper/Square.pm »
1 # Copyright (C) 2009-2021 Alex Schroeder <alex@gnu.org>
2 #
3 # This program is free software: you can redistribute it and/or modify it under
4 # the terms of the GNU Affero General Public License as published by the Free
5 # Software Foundation, either version 3 of the License, or (at your option) any
6 # later version.
7 #
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
11 # details.
12 #
13 # You should have received a copy of the GNU Affero General Public License along
14 # with this program. If not, see <http://www.gnu.org/licenses/>.
15  
16 =encoding utf8
17  
18 =head1 NAME
19  
20 Game::TextMapper::Log - a log singleton
21  
22 =head1 SYNOPSIS
23  
24 use Game::TextMapper::Log;
25 my $log = Game::TextMapper::Log->get();
26 $log->debug("Test");
27  
28 =head1 DESCRIPTION
29  
30 This allows multiple modules to use the same logger. If the log level or path
31 are changed by one of them, the change affects all the modules since they share
32 the same logger instance.
33  
34 This uses L<Mojo::Log>.
35  
36 =head1 SEE ALSO
37  
38 L<Mojo::Log>
39  
40 =cut
41  
42 package Game::TextMapper::Log;
43 11 ▶use Mojo::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45 11 my $log = Mojo::Log->new;
46  
47 121 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
48 121 return $log;
49 }
50  
51 11 1;
« script/text-mapper ↑ Summary blib/lib/Game/TextMapper/Mapper/Square.pm »