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

NameTypeDefaultDescription
LineCountnumberread-only
MaxLinesnumber100000 by default; past it, the oldest lines drop.
FontFontFont.Mono by default.
TextSizenumber
WrapbooleanLong 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.
LineNumbersboolean
Styles{ [string]: TextStyle }Named line styles, such as an Error style or a dimmed one, picked by the style argument of AppendLine and SetLine.
FollowTailbooleanWhen true it stays on the newest line; scrolling up pauses it and shows a "12 new" pill that resumes it.

Methods

NameArgumentsReturnsDescription
AppendLine(text: string, style: string?)numberAdds 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?)stringNever 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

NamePassesDescription
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