ID:2658320
 
(See the best response by LordAndrew.)
Code:
usr << "[world.log]"


Problem description:

Im trying to find a way to access the world.log from in-game. Store it as a string or a list or whatever it needs to be, and then read it as an output in-game.

Is there a way to actually do this? Just trying to pull the world.log var doesn't seem to work. It just gives me a blank output.

I want my staff in-game to be able to, if they need to, view runtime errors and some of my various world.log debugging outputs.
Best response
Per the reference, you can set world.log to output to a file, then read that file later:

world/New()
src.log = file("log.txt")

mob/verb/Test()
world.log << "Test."
// Force a runtime error to demonstrate that it will be logged to log.txt.
var x = "hello"
x:name = "test"


mob/verb/PrintLog()
src << file2text("log.txt")