MM feature request
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
MM feature request
I while ago, Admin told be about the "log.txt" feature that will print a stack trace an other usefull info, when a script causes errors.
After that I found it much easier to analyze script problems.
Usually I have multiple MM processes running. Yesterday I had a strange error happening with the RoM bot.
I looked into the log.txt and was thinking about posting the error here in the forum. Because it was very late
I decided to do it today. But it seems the "log.txt" gets overwritten each time an error occurs in a script.
My suggestion is to append to the log.txt instead of overwriting it. Maybe add on option to "config.lua"
as an advanced feature.
What do you think?
After that I found it much easier to analyze script problems.
Usually I have multiple MM processes running. Yesterday I had a strange error happening with the RoM bot.
I looked into the log.txt and was thinking about posting the error here in the forum. Because it was very late
I decided to do it today. But it seems the "log.txt" gets overwritten each time an error occurs in a script.
My suggestion is to append to the log.txt instead of overwriting it. Maybe add on option to "config.lua"
as an advanced feature.
What do you think?
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: MM feature request
log.txt is only overwritten when restarting MicroMacro. The problem is that if you run multiple instances of MicroMacro, they will fight overwhich one is writing to the log file.
It should be up to the individual scripts to handle most logging. It wouldn't take much to get a stack trace added to RoMBot's logs.
It should be up to the individual scripts to handle most logging. It wouldn't take much to get a stack trace added to RoMBot's logs.
Re: MM feature request
If I understood you correctly, it should be done by the bot itself. Then rock5 should take a look at this.
But I think it's still not really "clean" that all MM processes overwrite the same log file.
I need to take another attempt to compile MM myself. Last time I gave up after strange linker fixup errors...
But I think it's still not really "clean" that all MM processes overwrite the same log file.
I need to take another attempt to compile MM myself. Last time I gave up after strange linker fixup errors...
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: MM feature request
While I agree with you, I just wasn't able to come up with a good way to handle multiple instances of MicroMacro each having separate logs. I actually, at one point, experimented with the first copy opening up some shared memory which would be used to identify and assign each other copy unique IDs, which could then be used in the log name. Sure, it worked, but it seemed hackish and over-the-top.
I suppose it could log by base script name, but I'm not sure I like that much, either.
I suppose it could log by base script name, but I'm not sure I like that much, either.
Re: MM feature request
you could open and add to the file then save, all at the same time so that the info keeps getting added. This would of course make the file rather large over time which isn't ideal, by doing this though there wouldn't be any lost error reports.
You could set it up to clear the file each day though, only issue would be the midnight changing to next day to lose the reports that just occured.
Would be just a matter of having the day of the month as first line and then compare first line of the file with the current day according to os.date, if they are different then redo the file with the current day.
Either that or just create a log file using the bot by using the aterror function thingy, I have no idea how to do a stack trace though.
You could set it up to clear the file each day though, only issue would be the midnight changing to next day to lose the reports that just occured.
Would be just a matter of having the day of the month as first line and then compare first line of the file with the current day according to os.date, if they are different then redo the file with the current day.
Either that or just create a log file using the bot by using the aterror function thingy, I have no idea how to do a stack trace though.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: MM feature request
debug.traceback() returns the stack trace.
Re: MM feature request
Ok I'll post some stuff in the logger topic as it seems to be more about logging now, rather than continue it here in the MM section.
http://www.solarstrike.net/phpBB3/viewt ... 637#p48637
http://www.solarstrike.net/phpBB3/viewt ... 637#p48637
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests