Roblox UtilitiesDevlHub Roblox Documentation

Class

CustomLog

NotReplicated
Inherits
Instance › Object
Memory category
Instances

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#

CloseCloses the open log file.
GetLogPathReturns the full filesystem path of the log file.
OpenOpens the log file for writing, creating or truncating it.
WriteAppendAppends 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.

NameTypeDefaultDescription
appendstringThe text to append to the log file.
Returns
  • ()

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed