Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(minor) improve SNR of some error messages :)

  • Loading branch information...
commit a171053ab3626c69315c4a4d7966dd7aa2799df5 1 parent bcef2be
@sitaramc authored
Showing with 7 additions and 6 deletions.
  1. +6 −5 src/lib/Gitolite/Common.pm
  2. +1 −1  src/lib/Gitolite/Setup.pm
View
11 src/lib/Gitolite/Common.pm
@@ -251,17 +251,18 @@ sub gl_log {
my $tid = $ENV{GL_TID} ||= $$;
my $fh;
- logger_plus_stderr( "$ts no GL_LOGFILE env var", "$ts $msg" ) if not $ENV{GL_LOGFILE};
- open my $lfh, ">>", $ENV{GL_LOGFILE} or logger_plus_stderr( "open log failed: $!", $msg );
+ logger_plus_stderr( "errors found before logging could be setup", "$msg" ) if not $ENV{GL_LOGFILE};
+ open my $lfh, ">>", $ENV{GL_LOGFILE}
+ or logger_plus_stderr( "errors found before logfile could be created", "$msg" );
print $lfh "$ts\t$tid\t$msg\n";
close $lfh;
}
sub logger_plus_stderr {
open my $fh, "|-", "logger" or confess "it's really not my day is it...?\n";
- for ( "FATAL: have errors but logging failed!\n", @_ ) {
- print STDERR "$_\n";
- print $fh "$_\n";
+ for ( @_ ) {
+ print STDERR "FATAL: $_\n";
+ print $fh "FATAL: $_\n";
}
exit 1;
}
View
2  src/lib/Gitolite/Setup.pm
@@ -104,7 +104,7 @@ sub setup_glrc {
sub setup_gladmin {
my ( $admin, $pubkey, $argv ) = @_;
- _die "no existing conf file found, '-pk' or '-a' required"
+ _die "'-pk' or '-a' required; see 'gitolite setup -h' for more"
if not $admin and not -f "$rc{GL_ADMIN_BASE}/conf/gitolite.conf";
# reminder: 'admin files' are in ~/.gitolite, 'admin repo' is
Please sign in to comment.
Something went wrong with that request. Please try again.