เรียนรู้
Engine Class
LogService
ไม่สามารถสร้าง
บริการ

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
วิธีการ
Error(message: string,context: Dictionary):()
Info(message: string,context: Dictionary):()
Log(messageType: Enum.MessageType,message: string,context: Dictionary):()
Output(message: string,context: Dictionary):()
Warn(message: string,context: Dictionary):()
เหตุการณ์
สมาชิกที่ได้รับทอด

เอกสารอ้างอิงเกี่ยวกับ API
วิธีการ
ClearOutput
ความสามารถ: Logging
LogService:ClearOutput():()
ส่งค่ากลับ
()

Error
ความสามารถ: Logging
LogService:Error(
message:string, context:Dictionary
):()
พารามิเตอร์
message:string
context:Dictionary
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

GetLogHistory
ความสามารถ: Logging
LogService:GetLogHistory():{any}
ส่งค่ากลับ

Info
ความสามารถ: Logging
LogService:Info(
message:string, context:Dictionary
):()
พารามิเตอร์
message:string
context:Dictionary
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

Log
ความสามารถ: Logging
LogService:Log(
messageType:Enum.MessageType, message:string, context:Dictionary
):()
พารามิเตอร์
messageType:Enum.MessageType
message:string
context:Dictionary
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

Output
ความสามารถ: Logging
LogService:Output(
message:string, context:Dictionary
):()
พารามิเตอร์
message:string
context:Dictionary
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

Warn
ความสามารถ: Logging
LogService:Warn(
message:string, context:Dictionary
):()
พารามิเตอร์
message:string
context:Dictionary
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

เหตุการณ์
MessageOut
ความสามารถ: Logging
LogService.MessageOut(
message:string, messageType:Enum.MessageType, context:Dictionary
พารามิเตอร์
message:string
messageType:Enum.MessageType
context:Dictionary
ตัวอย่างโค้ด
LogService.MessageOut
local LogService = game:GetService("LogService")
local messageLabel = Instance.new("Message")
messageLabel.Parent = workspace
local function onMessageOut(message, messageType)
messageLabel.Text = "ข้อความคือ " .. message .. " และประเภทคือ " .. tostring(messageType)
end
LogService.MessageOut:Connect(onMessageOut)

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ