better log content (#365)

This commit is contained in:
Saeed Vaziry 2024-11-16 18:34:35 +01:00 committed by GitHub
parent 1ca72d7ddd
commit deb0b328e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,10 +132,12 @@ public function getContent($lines = null): ?string
return tail(Storage::disk($this->disk)->path($this->name), $lines); return tail(Storage::disk($this->disk)->path($this->name), $lines);
} }
return Storage::disk($this->disk)->get($this->name); $content = Storage::disk($this->disk)->get($this->name);
return $content ?? 'Empty log file!';
} }
return ''; return "Log file doesn't exist!";
} }
public static function log(Server $server, string $type, string $content, ?Site $site = null): static public static function log(Server $server, string $type, string $content, ?Site $site = null): static