ID:173743
 
When I leave my game running, I get that nice red error code every now and again, which is great for debugging. But, if Im gone long enough, it scrolls out of the char window. I tried logging it, but it only logs other stuff, not error code. How do I log this red error code so I can browse it later? I am getting server lag from procs crashing and such while im at work, and I have no way of seeing what proc is crashing to cause it unless im right there when it happens. So, I need to be able to log it. Please help me!

-Lutelian
Use world.log for changing the destination of error mesages. I believe this can be set to a filename (contrary to the documentation, which shows this working a different way), and then the log will output to a file.

Lummox JR
In response to Lummox JR
Setting world.log to anything [whether at compile-time or at world/New()] has never worked for me. I've tried file("whatever.txt") just "whatever.txt" and many other things. Never worked for me :-/
var/Log=file("log.txt")
proc/Log(text)
Log << "[time2text(world.realtime,"hh:mm:ss:DDD")]\n[text]\n"
mob/verb/test()
Log("This is a test log")


This is what i use for debug logging.
In response to Airjoe
Yeah, I tried setting world.log = file("zmylog.txt") and it didn't work. Maybe I just didn't know where to do it. That is why an example CODE demonstration would be nice, not just a word quick and eas fix. And why in the heck is this moved to newbie central from code problems? Anyways, to the guy who answered just output what you want to the log world.log << "code" that is not what I am talking about. I am talking about logging the error messages it spits out to you in dream seeker like error crash proc whatever call thread etc etc. If I could learn how to log these I could work out some of the rarer bugs in my game that happen when Im not on.

-Lutelian
In response to zackla21
Don't host in DreamSeeker then, host in DreamDaemon. All DreamDaemon'll have in it is any runtime errors, and things you send to world.log
In response to zackla21
zackla21 wrote:
Yeah, I tried setting world.log = file("zmylog.txt") and it didn't work. Maybe I just didn't know where to do it.

Like I said, you need to set it to a filename, not to a file(). I found that out myself not too long ago; the reference is in error here.

That is why an example CODE demonstration would be nice, not just a word quick and eas fix. And why in the heck is this moved to newbie central from code problems?

You had no code.

Anyways, to the guy who answered just output what you want to the log world.log << "code" that is not what I am talking about. I am talking about logging the error messages it spits out to you in dream seeker like error crash proc whatever call thread etc etc.

The world.log var does that as well.

If I could learn how to log these I could work out some of the rarer bugs in my game that happen when Im not on.

Fair enough. I hope you can work it out.

Lummox JR
In response to Lummox JR
Ok, code example:

world.log = file("zmylog.txt")

ok, now, what am I doing wrong and where do I need to put it so it logs the file? and to the other guy, dreamdaemon is a good idea, it saves those error messages, thanks for the help

-Lutelian
In response to zackla21
From what Lummox said, this should work:

world.log = "zmylog.txt"

I've never got world.log to work either, but it's worth a try. =)