bundling auto_version/;
use DBI ();
use List::Util 'first';
-use POSIX 'strftime';
use lib 'lib';
use Net::IMAP::Sync qw/read_config compact_set $IMAP_text $IMAP_cond/;
$LOCKFILE = $DBFILE =~ s/([^\/]+)\z/.$1.lck/r;
if (defined $CONF->{_} and defined $CONF->{_}->{logfile}) {
+ require 'POSIX.pm';
+ require 'Time/HiRes.pm';
open $LOGGER_FD, '>>', $CONF->{_}->{logfile}
or die "Can't open $CONF->{_}->{logfile}: $!\n";
$LOGGER_FD->autoflush(1);
return unless @_ and defined $LOGGER_FD;
my $prefix = '';
if ($LOGGER_FD->fileno != fileno STDERR) {
- $prefix = strftime "%b %e %H:%M:%S ", localtime;
+ my ($s, $us) = Time::HiRes::gettimeofday();
+ $prefix = POSIX::strftime("%b %e %H:%M:%S", localtime($s)).".$us ";
}
$prefix .= "$name: " if defined $name;
$LOGGER_FD->say($prefix, @_);
use Config::Tiny ();
use IO::Select ();
use List::Util 'first';
-use POSIX 'strftime';
use Socket 'SO_KEEPALIVE';
use Exporter 'import';
# are considered.
$self->{_MODIFIED} = {};
+ if (defined $self->{'logger-fd'} and $self->{'logger-fd'}->fileno != fileno STDERR) {
+ require 'POSIX.pm';
+ require 'Time/HiRes.pm';
+ }
+
# wait for the greeting
my $x = $self->_getline();
$x =~ s/\A\* (OK|PREAUTH) // or $self->panic($x);
return unless @_ and defined $self->{'logger-fd'};
my $prefix = '';
if ($self->{'logger-fd'}->fileno != fileno STDERR) {
- $prefix = strftime "%b %e %H:%M:%S ", localtime;
+ my ($s, $us) = Time::HiRes::gettimeofday();
+ $prefix = POSIX::strftime("%b %e %H:%M:%S", localtime($s)).".$us ";
}
$prefix .= defined "$self->{name}" ? $self->{name} : '';
$prefix .= "($self->{_SELECTED})" if $self->{_STATE} eq 'SELECTED';