use List::Util 'first';
use DBI ();
-use POSIX 'strftime';
use lib 'lib';
use Net::IMAP::Sync qw/read_config compact_set $IMAP_text $IMAP_cond/;
sub msg($@) {
my $name = shift;
return unless @_;
- my $prefix = strftime "%b %e %H:%M:%S", localtime;
- $prefix .= " $name" if defined $name;
- $prefix .= ': ';
+ my $prefix = defined $name ? "$name: " : '';
print STDERR $prefix, @_, "\n";
}
use Config::Tiny ();
use List::Util 'first';
use Socket 'SO_KEEPALIVE';
-use POSIX 'strftime';
use Exporter 'import';
BEGIN {
sub log($@) {
my $self = shift;
return unless @_;
- my $prefix = strftime "%b %e %H:%M:%S", localtime;
- $prefix .= " $self->{name}" if defined $self->{name};
+ my $prefix = defined $self->{name} ? $self->{name} : '';
$prefix .= "($self->{_SELECTED})" if $self->{_STATE} eq 'SELECTED';
$prefix .= ': ';
$self->{STDERR}->say($prefix, @_);