Allow developers to set the call site of output functions

As a Roblox developer, it is currently impossible to make a custom logging library without the ‘click to jump to script’ mechanism navigating to the logging library itself calling print, warn, error, etc instead of the site where the logging library function was called.

This is very inconvenient because in order to find where the message was emitted, I need to search for the message in Find or Find All and hunt for the script manually instead of being able to click on the output message to jump to it.

My current workaround is, if RunService:IsStudio() is true, to disable the functionality of my logging library entirely and return print, warn, or error directly so the ‘click to jump to script’ functionality remains accurate.This is inconvenient because I would like to retain the utility of my logging library where I have custom logic such as formatting, uploading to a cloud logging service, filtering based on log level, etc.

If Roblox is able to address this issue, it would improve my development experience because I could utilize custom logging libraries while maintaining the convenience of being able to click on output messages to navigate to the relevant script & line.

16 Likes

I’m going to add onto this with a real-world use case example - I have a structured logging library for Roblox called Log (original name, I know).

If you use the Roblox output sink - it displays the actual sink’s print/warn call sites as the link - which as mentioned in OP is very unhelpful, rather than the call sites of the logging functions themselves (which would be much more helpful!)


As you can see here they’re all linked to LogEventRobloxOutputSink:71 - these should all be linked to the original call sites for each log, not the sink itself. There’s no way of currently explicitly defining this.

e.g. for the first outputted message above the logging call looks like:

this.logger.Info("Loaded character {CharacterId} for {UserId}", data.GetId(), robloxPlayer.UserId);

So the output: [INF] Loaded character {CharacterId} for {UserId} - Server - LogEventRobloxOutputSink:71
would ideally be
[INF] Loaded character {CharacterId} for {UserId} - Server - PlayerService:63 (Because this is where I called Log.Info in that particular instance)

So would definitely appreciate a way to explicitly set the logging source/link.

4 Likes