File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ public function logs(): LogReader
51
51
52
52
public function size (): int
53
53
{
54
- return LogViewer::getFilesystem ()->size ($ this ->path );
54
+ return LogViewer::getFilesystem ()->exists ()
55
+ ? LogViewer::getFilesystem ()->size ($ this ->path )
56
+ : 0 ;
55
57
}
56
58
57
59
public function sizeInMB (): float
@@ -104,13 +106,13 @@ public function getLastScannedFilePositionForQuery(?string $query = ''): ?int
104
106
public function earliestTimestamp (): int
105
107
{
106
108
return $ this ->getMetadata ('earliest_timestamp ' )
107
- ?? LogViewer::getFilesystem ()->lastModified ($ this ->path );
109
+ ?? LogViewer::getFilesystem ()->exists ( $ this -> path ) ? LogViewer:: getFilesystem ()-> lastModified ($ this ->path ) : 0 ;
108
110
}
109
111
110
112
public function latestTimestamp (): int
111
113
{
112
114
return $ this ->getMetadata ('latest_timestamp ' )
113
- ?? LogViewer::getFilesystem ()->lastModified ($ this ->path );
115
+ ?? LogViewer::getFilesystem ()->exists ( $ this -> path ) ? LogViewer:: getFilesystem ()-> lastModified ($ this ->path ) : 0 ;
114
116
}
115
117
116
118
public function scan (int $ maxBytesToScan = null , bool $ force = false ): void
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ protected function getFilePathsMatchingPattern($pattern)
73
73
public function basePathForLogs (): string
74
74
{
75
75
$ rootFolder = Str::of (config ('log-viewer.filesystem.root ' ));
76
- return empty ($ rootFolder )
76
+ return ($ rootFolder != "" )
77
77
? $ rootFolder ->finish ('/ ' )
78
78
: $ rootFolder ;
79
79
}
You can’t perform that action at this time.
0 commit comments