Can't detect LogService.MessageOut type

I want to make a custom console where if there’s a print() it will be placed at the UI using LogService.MessageOut. But my problem is, using MessageType to detect if its a print or a warn. it didn’t detect if it is.

I’ve Tried

if tostring(Type) == Enum.MessageType.MessageOutput then
if Type == 0 then

In Addition
I put print("This is a test") to test if its working but what happen is


instead of

nevermind, i ended up using
if Type == Enum.MessageType.MessageOutput then
and it finally works!

if tostring(Type) == Enum.MessageType.MessageOutput then

Yeah, you can’t compare a string value with a MessageType instance for equality.