From: Guilhem Moulin Date: Thu, 23 Jul 2015 23:27:43 +0000 (+0200) Subject: Don't prefix logs by a timestamp, that's a syslog thing. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=a8445f6da256a09bac321a0bd2c23e3b8424caf4;p=interimap.git Don't prefix logs by a timestamp, that's a syslog thing. --- diff --git a/imapsync b/imapsync index a759250..f80106d 100755 --- a/imapsync +++ b/imapsync @@ -28,7 +28,6 @@ use Getopt::Long qw/:config posix_default no_ignore_case gnu_compat 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/; @@ -169,9 +168,7 @@ $DBH->do('PRAGMA foreign_keys = ON'); 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"; } diff --git a/lib/Net/IMAP/Sync.pm b/lib/Net/IMAP/Sync.pm index 11bfba4..bb99dcb 100644 --- a/lib/Net/IMAP/Sync.pm +++ b/lib/Net/IMAP/Sync.pm @@ -23,7 +23,6 @@ use strict; use Config::Tiny (); use List::Util 'first'; use Socket 'SO_KEEPALIVE'; -use POSIX 'strftime'; use Exporter 'import'; BEGIN { @@ -401,8 +400,7 @@ sub DESTROY($) { 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, @_);