Class · inherits Instance
CustomLog
Internal-only instance that writes text to a file in the engine's logs directory.
About CustomLog
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.Closes the file handle previously opened by
CustomLog.Open. Closing an already-closed log has no effect.GetLogPath
() → stringReturns the full filesystem path of the log file.Returns the full filesystem path of the log file targeted by
CustomLog.Open. The path is set whenCustomLog.Openis called and is derived from the instance'sInstance.Name; it is empty before the log has been opened.Open
() → ()Opens the log file for writing, creating or truncating it.Opens a file named after the instance's
Instance.Name(with a.logextension) 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.Nameis empty, if the name resolves to a path outside the logs directory, or if the file otherwise fails to open.WriteAppend
(append: string) → ()Appends a string to the open log file.Writes
appendto 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.Openfirst) or if the write fails.
CustomLog also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.