LogView
Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.
Up and coming
Stream thousands of lines of output into one fast view: append, rewrite a line in place, fold a long block and find text.
Lines are kept in the view itself rather than as objects, so a long log makes no instances and an append never resends what is there; only the lines on screen are laid out. Text is drawn as written, with no markup to escape. Drag-select, Ctrl+C, Ctrl+A, a Ctrl+F find bar, smooth wheel scrolling, Home and End are built in, and FollowTail keeps the newest line in view.
Made with Instance.new("LogView") or Clone().
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| LineCount | number | read-only | |
| MaxLines | number | 100000 by default; past it, the oldest lines drop. | |
| Font | Font | Font.Mono by default. | |
| TextSize | number | ||
| Wrap | boolean | Long lines wrap at the width and re-wrap on resize, keeping the same line at the top. | |
| Syntax | "None" | "Luau" | "Json" | "Diff" | "Markdown" | Colours spans in the chosen syntax, such as a change shown as a Diff. | |
| LineNumbers | boolean | ||
| Styles | { [string]: TextStyle } | Named line styles, such as an Error style or a dimmed one, picked by the style argument of AppendLine and SetLine. | |
| FollowTail | boolean | When true it stays on the newest line; scrolling up pauses it and shows a "12 new" pill that resumes it. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| AppendLine | (text: string, style: string?) | number | Adds a line and returns its index. |
| Append | (text: string) | () | Adds text to the last line; a line break inside it starts new lines, for streamed output. |
| SetLine | (index: number, text: string, style: string?) | () | Rewrites one line in place, for a status that changes as it runs. |
| Fold | (first: number, last: number, collapsed: boolean) | () | Folds a range of lines to its first line with an arrow, for a long result. |
| Clear | () | () | |
| GetText | (first: number?, last: number?) | string | Never yields: a copy of the lines is kept on your program's side. |
| Find | (query: string) | { number } | |
| ScrollToLine | (index: number) | () | Glides to the line. |
Events
| Name | Passes | Description |
|---|---|---|
| LineClicked | (number, string?) | Passes the line's index and style; while it is connected, lines answer hover and press. |
From UIObject 19
From ScreenItem 2
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
