LogService

사용되지 않는 항목 표시
만들 수 없음
서비스

Important notes about this service: This service might have unexpected or unreliable behavior depending on how games and the game engine log things. Content might also be truncated. Don't rely on contents of events and messages emitted by this service for any important game logic.

A service that allows you to read outputted text.

요약

메서드

  • Clears the Roblox Studio output window.

  • Returns a table of tables, each with the message string, message type, and timestamp of a message that the client displays in the output window.

이벤트

속성

메서드

ClearOutput

void

Clears the Roblox Studio output window.

The log history is also cleared, such that LogService.GetLogHistory will not return any entries from before the LogService.ClearOutput call.


반환

void

GetLogHistory

Unreliable Behavior This may have changing, unexpected or unreliable behavior depending on how the game engine logs things. It should not be relied upon for any important game logic.

Returns a table of tables, each with the message string, message type, and timestamp of a message that the client displays in the output window.

See also:


반환

이벤트

MessageOut

Fires when the client outputs text.

매개 변수

message: string
messageType: Enum.MessageType

코드 샘플

LogService.MessageOut

local LogService = game:GetService("LogService")
local messageLabel = Instance.new("Message")
messageLabel.Parent = workspace
local function onMessageOut(message, messageType)
messageLabel.Text = "The message was " .. message .. " and the type was " .. tostring(messageType)
end
LogService.MessageOut:Connect(onMessageOut)