| 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; | |