Package io.github.jbastgen.stemma.app.io
Class LogFiles
java.lang.Object
io.github.jbastgen.stemma.app.io.LogFiles
Finding, reading and searching the daily log files (
stemma-YYYY-MM-DD.log) for the log page of the About dialog.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat was read.static final recordThe lines that contain the search text, without regard to case; all lines when it is blank.static enumWhich log: the one of the application, or the one of the requests to AI services.static enumWhich lines of the log to show: all, those of level info and above, or only warnings and errors. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longHow much of a file is read: the end of it, which is where the news is. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe lastcountlines of the text (all of it if it is shorter).The application log files indir, newest first; empty if the folder is missing or cannot be read.list(Path dir, LogFiles.Kind kind) The log files of one kind indir, newest first.static Stringsize(long bytes) "12 KB", "3.4 MB".static LogFiles.ContentReads the lastmaxBytesof the file as text (UTF-8); a line that is cut in the middle is dropped.static LogFiles.Filteredview(String text, LogFiles.Level level, String query) What the log page shows: the lines of at least this level that also contain the search text.
-
Field Details
-
MAX_BYTES
public static final long MAX_BYTESHow much of a file is read: the end of it, which is where the news is.- See Also:
-
-
Method Details
-
list
The application log files indir, newest first; empty if the folder is missing or cannot be read. -
list
The log files of one kind indir, newest first. -
tail
Reads the lastmaxBytesof the file as text (UTF-8); a line that is cut in the middle is dropped.- Throws:
IOException
-
view
What the log page shows: the lines of at least this level that also contain the search text. A line without a level (the lines of a stack trace) belongs to the line before it and is shown with it. -
lastLines
The lastcountlines of the text (all of it if it is shorter). -
size
"12 KB", "3.4 MB".
-