package Blacknote::Logging; use strict; use warnings FATAL => qw(all); use Exporter qw(import); use Curses; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init( {level => $DEBUG , file => ">blacknote.log", category => __PACKAGE__, layout=>"[%d][[%L] %M][%p]: %m%n"} ); BEGIN{ $SIG{__DIE__} = sub { echo; cbreak; endwin; FATAL(@_) if @_;}; $SIG{TERM} = sub { $SIG{__DIE__}->(); exit;}; $SIG{INT} = sub { INFO "Exiting program on interrupt"; $SIG{TERM}->() }; } our @EXPORT = qw(DEBUG TRACE INFO ERROR WARN FATAL); 1; .