You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-09-02 12:41:14 +03:00
Added the log-level-stderr option.
Controls whether console log messages are sent to stderr or stdout. By default this is set to warn which represents a change in behavior from previous versions, even though it may be more intuitive. Setting log-level-stderr=off will preserve the old behavior. Suggested by Sascha Biberhofer.
This commit is contained in:
@@ -245,32 +245,53 @@ sub process
|
||||
my $strCommand = OP_NOOP;
|
||||
|
||||
# Loop until the exit command is received
|
||||
while ($strCommand ne OP_EXIT)
|
||||
eval
|
||||
{
|
||||
($strCommand, $self->{hParam}) = $self->cmdRead();
|
||||
|
||||
eval
|
||||
while ($strCommand ne OP_EXIT)
|
||||
{
|
||||
if (!$self->commandProcess($strCommand))
|
||||
($strCommand, $self->{hParam}) = $self->cmdRead();
|
||||
|
||||
eval
|
||||
{
|
||||
if ($strCommand eq OP_NOOP)
|
||||
if (!$self->commandProcess($strCommand))
|
||||
{
|
||||
$self->outputWrite();
|
||||
if ($strCommand eq OP_NOOP)
|
||||
{
|
||||
$self->outputWrite();
|
||||
}
|
||||
elsif ($strCommand ne OP_EXIT)
|
||||
{
|
||||
confess "invalid command: ${strCommand}";
|
||||
}
|
||||
}
|
||||
elsif ($strCommand ne OP_EXIT)
|
||||
{
|
||||
confess "invalid command: ${strCommand}";
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
# Process errors
|
||||
or do
|
||||
{
|
||||
$self->errorWrite($EVAL_ERROR);
|
||||
};
|
||||
}
|
||||
# Process errors
|
||||
or do
|
||||
{
|
||||
$self->errorWrite($EVAL_ERROR);
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
or do
|
||||
{
|
||||
my $oException = $EVAL_ERROR;
|
||||
|
||||
# Change log level so error will go to stderr
|
||||
logLevelSet(undef, undef, ERROR);
|
||||
|
||||
# If standard exception
|
||||
if (isException($oException))
|
||||
{
|
||||
confess &log($oException->level(), $oException->message(), $oException->code());
|
||||
}
|
||||
|
||||
# Else unexpected Perl exception
|
||||
confess &log(ERROR, 'unknown error: ' . $oException, ERROR_UNKNOWN);
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -295,7 +295,7 @@ sub lineRead
|
||||
{
|
||||
if (!defined($bError) || $bError)
|
||||
{
|
||||
confess &log(ERROR, "unable to read line after ${fTimeout} seconds", ERROR_PROTOCOL_TIMEOUT);
|
||||
confess &log(ERROR, "unable to read line after ${fTimeout} second(s)", ERROR_PROTOCOL_TIMEOUT);
|
||||
}
|
||||
|
||||
return;
|
||||
|
Reference in New Issue
Block a user