Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Refactor code to use loggy() function for server storage check logging

Andras Bacsai29ad9656563f
diff --git a/app/Jobs/ServerStorageCheckJob.php b/app/Jobs/ServerStorageCheckJob.php
index 7c3916954e..c646f77eb6 100644
--- a/app/Jobs/ServerStorageCheckJob.php
+++ b/app/Jobs/ServerStorageCheckJob.php
@@ -10,7 +10,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\RateLimiter;
class ServerStorageCheckJob implements ShouldBeEncrypted, ShouldQueue
@@ -39,7 +38,7 @@ class ServerStorageCheckJob implements ShouldBeEncrypted, ShouldQueue
if (is_null($this->percentage)) {
$this->percentage = $this->server->storageCheck();
- Log::info('Server storage check percentage: '.$this->percentage);
+ loggy('Server storage check percentage: '.$this->percentage);
}
if (! $this->percentage) {
return 'No percentage could be retrieved.';
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index dbab6861d4..1374070e4d 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -30,6 +30,7 @@ use App\Notifications\Channels\TelegramChannel;
use App\Notifications\Internal\GeneralNotification;
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use Illuminate\Database\UniqueConstraintViolationException;
+use Illuminate\Log\LogManager;
use Illuminate\Mail\Message;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Process\Pool;
@@ -4013,7 +4014,7 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire
}
}
-function loggy($message = null, array $context = [])
+function loggy($message = null, array $context = []): LogManager
{
if (! isDev()) {
return;