1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Technical programming question (circular buffers &#38; logging) -->
<!--X-From-R13: Pra Uerrne <terrneNploreuvtujnl.arg> -->
<!--X-Date: Thu, 15 Jul 1999 19:06:49 &#45;0700 -->
<!--X-Message-Id: 378E8A34.97872526#cyberhighway,net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199907150435.WAA02423@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Technical programming question (circular buffers</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:greear#cyberhighway,net">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00921.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00923.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00911.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00917.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00922">Author</A>
&nbsp;|&nbsp;<A HREF="#00922">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00922">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</LI>
<LI><em>From</em>: Ben Greear &lt;<A HREF="mailto:greear#cyberhighway,net">greear#cyberhighway,net</A>&gt;</LI>
<LI><em>Date</em>: Thu, 15 Jul 1999 18:26:12 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:greear#burrito,cyberhighway.net">greear#burrito,cyberhighway.net</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Chris Gray wrote:
&gt; 
&gt; [Ben Greear:]
&gt; 
&gt; &gt; So, what I want to do is modify my logging class (basically just
&gt; &gt; an ofstream with some flags tacked on it).  I was thinking about
&gt; &gt; making it a sort of ring-buffer where it just kept the last 50k
&gt; &gt; or some other nice round number.
&gt; 
&gt; I've used that technique both in my MUD and at work. It works pretty well.
&gt; Rather than getting complex and logging full text messages, however, we've
&gt; tended to just log simpler things. My MUD just logs a pointer to a text
&gt; message, and a single 32 bit value. If the system itself aborts, it
&gt; dumps the contents of the ring out - it deferences the string pointers
&gt; to get the actual text. I think there was an occasion at work where I
&gt; needed to look at the buffer in a core dump, and it was a bit clumsy,
&gt; 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?)

&gt; Should work, as long as you rely on as little as possible in the dumping
&gt; code. E.g. open the logging file with a low level 'open' call, write
&gt; it out with no use of stdio, iostream, etc., then close it. That should
&gt; minimize the amount of code/data you depend on, and reduce the likelihood
&gt; of a nested SEGV.

Sound's like a good idea, but I'm going quick and dirty for now.. :)



-- 
Ben Greear (greear#cyberhighway,net)  <A  HREF="http://scry.wanfear.com/~greear">http://scry.wanfear.com/~greear</A> 
Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
<A  HREF="http://scry.wanfear.com">http://scry.wanfear.com</A>


_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00911" HREF="msg00911.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></STRONG>
<UL><LI><EM>From:</EM> Chris Gray &lt;cg#ami-cg,GraySage.Edmonton.AB.CA&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00921.html">[MUD-Dev] fwd: forum on game design/culture</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00923.html">Re: [MUD-Dev] pfiles</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00911.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00917.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00922"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00922"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] an idea..wondering if this has been done</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00931" HREF="msg00931.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></strong>, 
bruce <a href="mailto:bruce#puremagic,com">bruce#puremagic,com</a>, Mon 19 Jul 1999, 16:47 GMT
</LI>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00901" HREF="msg00901.html">[MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Thu 15 Jul 1999, 02:34 GMT
<UL>
<LI><strong><A NAME="00914" HREF="msg00914.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 15 Jul 1999, 22:05 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00911" HREF="msg00911.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 15 Jul 1999, 18:24 GMT
<UL>
<LI><strong><A NAME="00922" HREF="msg00922.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 16 Jul 1999, 02:06 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00917" HREF="msg00917.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 16 Jul 1999, 00:42 GMT
<UL>
<LI><strong><A NAME="00927" HREF="msg00927.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Fri 16 Jul 1999, 19:05 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00926" HREF="msg00926.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 16 Jul 1999, 19:05 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00888" HREF="msg00888.html">[MUD-Dev] list of MUD platforms?</A></strong>, 
Timothy O'Neill Dang <a href="mailto:timothy#nmia,com">timothy#nmia,com</a>, Wed 14 Jul 1999, 00:23 GMT
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>