File Coverage

blib/lib/Game/HexDescribe/Log.pm
Criterion Covered Total %
statement 4 4 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod 0 1 0.0
total 6 7 85.7


line stmt bran cond sub pod time code
1             # Copyright (C) 2009-2022 Alex Schroeder
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 .
15              
16             =encoding utf8
17              
18             =head1 NAME
19              
20             Game::HexDescribe::Log - a log singleton
21              
22             =head1 SYNOPSIS
23              
24             use Game::HexDescribe::Log;
25             my $log = Game::HexDescribe::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.
35              
36             =head1 SEE ALSO
37              
38             L
39              
40             =cut
41              
42             package Game::HexDescribe::Log;
43 1     1   7 use Mojo::Log;
  1         2  
  1         10  
44              
45             my $log = Mojo::Log->new;
46              
47             sub get {
48 2     2 0 10 return $log;
49             }
50              
51             1;