I need help with a dev console

  1. What do you want to achieve? I want to redirect errors/warnings from server console to client console

  2. What is the issue? I can’t find it on devforum

  3. What solutions have you tried so far? I tried to find something like module for devconsole to make it output items from server console to client but it didn’t worked

Use LogService.MessageOut

local LogService = game:GetService("LogService")

local MessageOutEvent : RemoteEvent

LogService.MessageOut:Connect(function(Message, MessageType)
	MessageOutEvent:FireAllClients(Message, MessageType)
end)

Client:

local MessageOutEvent : RemoteEvent

MessageOutEvent.OnClientEvent:Connect(function(Message, MessageType)
	if MessageType == Enum.MessageType.MessageError then
		coroutine.wrap(function()
			error(Message)
		end)()
	elseif MessageType == Enum.MessageType.MessageWarning then
		warn(Message)
	else
		print(Message)
	end
end)
2 Likes
coroutine.wrap(function()
	error(Message)
end)()

What’s the purpose of coroutine.wrap? Errors are propagated to the wrapper function anyway resulting in a termination of the call stack.

local Map = {
	MessageOutput = print,
	MessageInfo = print,
	MessageWarning = warn,
	MessageError = error
}

local function OnRemoteFired(MessageType, Message)
	Map[MessageType.Name](Message)
end

RemoteEvent.OnClientEvent:Connect(OnRemoteFired)
2 Likes