Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Technical programming question (circular buffers & logging)
Chris Gray wrote:
>
> [Ben Greear:]
>
> > So, what I want to do is modify my logging class (basically just
> > an ofstream with some flags tacked on it). I was thinking about
> > making it a sort of ring-buffer where it just kept the last 50k
> > or some other nice round number.
>
> I've used that technique both in my MUD and at work. It works pretty well.
> Rather than getting complex and logging full text messages, however, we've
> tended to just log simpler things. My MUD just logs a pointer to a text
> message, and a single 32 bit value. If the system itself aborts, it
> dumps the contents of the ring out - it deferences the string pointers
> to get the actual text. I think there was an occasion at work where I
> needed to look at the buffer in a core dump, and it was a bit clumsy,
> but certainly doable.
Ok, got mine working pretty good. One problem though. I catch the SIGSEGV,
so there is no core file. Is there a way I can still get a core file as if
it was not caught (and still catch it?)
> Should work, as long as you rely on as little as possible in the dumping
> code. E.g. open the logging file with a low level 'open' call, write
> it out with no use of stdio, iostream, etc., then close it. That should
> minimize the amount of code/data you depend on, and reduce the likelihood
> of a nested SEGV.
Sound's like a good idea, but I'm going quick and dirty for now.. :)
--
Ben Greear (greear#cyberhighway,net) http://scry.wanfear.com/~greear
Author of ScryMUD: scry.wanfear.com 4444 (Released under GPL)
http://scry.wanfear.com
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] an idea..wondering if this has been done, (continued)
- [MUD-Dev] Technical programming question (circular buffers & logging),
Ben Greear greear#cyberhighway,net, Thu 15 Jul 1999, 02:34 GMT
- <Possible follow-up(s)>
- Re: [MUD-Dev] Technical programming question (circular buffers & logging),
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Thu 15 Jul 1999, 18:24 GMT
- Re: [MUD-Dev] Technical programming question (circular buffers & logging),
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 16 Jul 1999, 00:42 GMT
- Re: [MUD-Dev] Technical programming question (circular buffers & logging),
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 16 Jul 1999, 19:05 GMT
- [MUD-Dev] list of MUD platforms?,
Timothy O'Neill Dang timothy#nmia,com, Wed 14 Jul 1999, 00:23 GMT
[ Other Periods
| Other mailing lists
| Search
]