LogService not getting tables

Reproduction Steps

Run this on a script:

local LogService = game:GetService("LogService")
local TxtLog = ''

print('test')
print({1, 2, 3})
print('----------')

LogService.MessageOut:Connect(function(Message, Type)
	TxtLog = TxtLog .. '\n' .. Message
end)

wait() -- don't know why, but without this, GetLogHistory will print an empty table

print('GetLogHistory', LogService:GetLogHistory())
print('TxtLog', TxtLog)

Expected Behavior

Both results of print('test') and print({1, 2, 3}) should be captured by LogService

Actual Behavior

Tables are not being captured by LogService:

  test
   ▼  {
    [1] = 1,
    [2] = 2,
    [3] = 3
  }
  ----------
  GetLogHistory  ▼  {
    [1] =  ▼  {
       ["message"] = "test",
       ["messageType"] = MessageOutput,
       ["timestamp"] = 1654287546.045
    },
    [2] =  ▼  {
       ["message"] = "----------",
       ["messageType"] = MessageOutput,
       ["timestamp"] = 1654287546.045
    }
  }
  TxtLog 
test
----------

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly

Seems like this might be a duplicate of LogService.MessageOut ignores printed tables

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.