remove some logs

This commit is contained in:
Saeed Vaziry
2023-08-06 23:04:01 +02:00
parent 94f14dc7a7
commit c2d515f9e5
5 changed files with 94 additions and 121 deletions

View File

@ -76,10 +76,6 @@ public function connect(bool $sftp = false): void
if (! $login) {
throw new SSHAuthenticationError("Error authenticating");
}
Log::info("Login status", [
'status' => $login
]);
} catch (Throwable $e) {
Log::error("Error connecting", [
"msg" => $e->getMessage()
@ -122,15 +118,10 @@ public function upload(string $local, string $remote): void
{
$this->log = null;
Log::info("Starting to upload");
if (! $this->connection) {
$this->connect(true);
}
Log::info("Uploading");
$uploaded = $this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
Log::info("Upload finished", [
'status' => $uploaded
]);
$this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
}
/**
@ -139,28 +130,17 @@ public function upload(string $local, string $remote): void
protected function executeCommand(string|SSHCommand $command): string
{
if ($command instanceof SSHCommand) {
$commandContent = $command->content($this->server->os);
$commandContent = $command->content();
} else {
$commandContent = $command;
}
Log::info("command", [
"asUser" => $this->asUser,
"content" => $commandContent
]);
if ($this->asUser) {
$commandContent = 'sudo su - '.$this->asUser.' -c '.'"'.addslashes($commandContent).'"';
}
Log::info("Running command", [
"cmd" => $commandContent
]);
$output = $this->connection->exec($commandContent);
Log::info("Command executed");
$this->log?->write($output);
if (Str::contains($output, 'VITO_SSH_ERROR')) {

View File

@ -8,7 +8,6 @@
use Aws\Ec2\Ec2Client;
use Aws\EC2InstanceConnect\EC2InstanceConnectClient;
use Exception;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class AWS extends AbstractProvider
@ -35,8 +34,6 @@ public function createValidationRules(array $input): array
}
$rules['region'] = 'required|in:'.implode(',', $regions);
Log::info("AWS Creation Rules", $rules);
return $rules;
}
@ -116,8 +113,6 @@ public function isRunning(): bool
return true;
}
}
Log::info($result);
}
return false;

View File

@ -133,8 +133,6 @@ public function deployKey(string $title, string $repo, string $key): void
]
);
info('github response', $response->json());
if ($response->status() != 201) {
throw new FailedToDeployGitKey(json_decode($response->body())->message);
}