#Differentiate between multiple sessions
9 messages · Page 1 of 1 (latest)
It does seem like there is a built in way to get that info. But you could do a little extra work to get a workaround going.
Set the window title and prefix your log messages.
# Global per instance
var instance_identifier = str(randi())
# Should only be called once
func _ready():
DisplayServer.window_set_title(instance_identifier)
func your_other_func():
print(instance_identifier, " ", "Text")
Alternatively, you can start the editor in a separate terminal and run the second instance there.
Okay, thanks 🙂
Still not perfect though, because I can't find a relation to the debugger, which session is which random number in the debugger window...
I could just throw an exception with the instance_identifier, which would show up in the debugger window, but that's pretty ugly
yes that is correct. This approach does not integrate well with the debugger.
Are you using windows as an operating system?
Nope linux
ok, but you could potentially use the same or a similar "trick" as me to know what window belongs to which session 🙂 (probably depends heavily on your desktop environment)
The first window always belongs the the first session and the second window always belongs to the second session.
Hope that works for you as well 😄
Okay, I think that was not always true for me in the past... But not sure