diff options
author | Josh <josh.t.richards@gmail.com> | 2025-06-25 10:17:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-25 10:17:06 -0400 |
commit | 002de3c06780218f1e93d38eb06e69356d5dd160 (patch) | |
tree | 3fb5a46efc509bf0ffadeaff63900876bb9f10f3 | |
parent | 42500617e2a07b29bfa24d3ea68003c21ba810c2 (diff) | |
download | nextcloud-server-002de3c06780218f1e93d38eb06e69356d5dd160.tar.gz nextcloud-server-002de3c06780218f1e93d38eb06e69356d5dd160.zip |
chore(Log): remove unused getEntries method from File
Signed-off-by: Josh <josh.t.richards@gmail.com>
-rw-r--r-- | lib/private/Log/File.php | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index ba428ba185b..d0fc99c986b 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -69,52 +69,7 @@ class File extends LogDetails implements IWriter, IFileBased { } } - /** - * get entries from the log in reverse chronological order - */ - public function getEntries(int $limit = 50, int $offset = 0): array { - $minLevel = $this->config->getValue('loglevel', ILogger::WARN); - $entries = []; - $handle = @fopen($this->logFile, 'rb'); - if ($handle) { - fseek($handle, 0, SEEK_END); - $pos = ftell($handle); - $line = ''; - $entriesCount = 0; - $lines = 0; - // Loop through each character of the file looking for new lines - while ($pos >= 0 && ($limit === null || $entriesCount < $limit)) { - fseek($handle, $pos); - $ch = fgetc($handle); - if ($ch == "\n" || $pos == 0) { - if ($line != '') { - // Add the first character if at the start of the file, - // because it doesn't hit the else in the loop - if ($pos == 0) { - $line = $ch . $line; - } - $entry = json_decode($line); - // Add the line as an entry if it is passed the offset and is equal or above the log level - if ($entry->level >= $minLevel) { - $lines++; - if ($lines > $offset) { - $entries[] = $entry; - $entriesCount++; - } - } - $line = ''; - } - } else { - $line = $ch . $line; - } - $pos--; - } - fclose($handle); - } - return $entries; - } - - public function getLogFilePath():string { + public function getLogFilePath(): string { return $this->logFile; } } |