File: screen-helper.pl

package info (click to toggle)
liblog-dispatch-perl 2.71-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 560 kB
  • sloc: perl: 1,457; sh: 24; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;
use warnings;

use Getopt::Long;
use Log::Dispatch;
use Log::Dispatch::Screen;

my ( $stderr, $utf8 );
GetOptions(
    'stderr' => \$stderr,
    'utf8'   => \$utf8,
);

my $dispatch = Log::Dispatch->new(
    outputs => [
        [
            Screen => (
                name      => 'screen',
                min_level => 'debug',
                newline   => 1,
                stderr    => $stderr,
                utf8      => $utf8,
            ),
        ]
    ],
);

my $message = 'test message';
$message .= " - \x{1f60}" if $utf8;
$dispatch->warning($message);

exit 0;