MM feature request

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
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.
Post Reply
Message
Author
Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

MM feature request

#1 Post by Jandrana » Mon Mar 11, 2013 4:57 am

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?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM feature request

#2 Post by Administrator » Mon Mar 11, 2013 10:15 am

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.

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: MM feature request

#3 Post by Jandrana » Tue Mar 12, 2013 7:22 am

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...

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM feature request

#4 Post by Administrator » Tue Mar 12, 2013 9:53 am

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.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: MM feature request

#5 Post by lisa » Tue Mar 12, 2013 10:30 am

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.
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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM feature request

#6 Post by Administrator » Tue Mar 12, 2013 10:57 am

debug.traceback() returns the stack trace.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: MM feature request

#7 Post by lisa » Tue Mar 12, 2013 7:36 pm

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
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

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: MM feature request

#8 Post by dx876234 » Wed Apr 17, 2013 6:26 am

deleted

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests