Class
CustomLog
NotReplicated
Internal-only instance that writes text to a file in the engine's logs directory.
Internal-only (InternalTest security); not available to ordinary experience
scripts. CustomLog writes text to a file in the engine's logs
directory: CustomLog:Open() creates a file named after the instance's
Instance.Name (with a .log extension),
CustomLog:WriteAppend() appends text, and CustomLog:Close()
closes the file handle. The instance cannot be parented to or contain other
instances.
Methods 4#
| Close | Closes the open log file. |
| GetLogPath | Returns the full filesystem path of the log file. |
| Open | Opens the log file for writing, creating or truncating it. |
| WriteAppend | Appends a string to the open log file. |
Close(): ()#
Closes the file handle previously opened by CustomLog:Open().
Closing an already-closed log has no effect.
Returns
()
GetLogPath(): string#
Returns the full filesystem path of the log file targeted by
CustomLog:Open(). The path is set when CustomLog:Open() is
called and is derived from the instance's Instance.Name; it is
empty before the log has been opened.
Returns
string— The absolute filesystem path of the log file.
Open(): ()#
Opens a file named after the instance's Instance.Name (with a
.log extension) in the engine's logs directory, truncating any existing
contents so that writing starts from an empty file.
This method throws a runtime error if the log is already open, if
Instance.Name is empty, if the name resolves to a path outside the
logs directory, or if the file otherwise fails to open.
Returns
()
WriteAppend(append: string): ()#
Writes append to the end of the open log file. The text is written
verbatim, without adding a trailing newline.
This method throws a runtime error if the log is not open (call
CustomLog:Open() first) or if the write fails.
| Name | Type | Default | Description |
|---|---|---|---|
append | string | The text to append to the log file. |
Returns
()
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild