1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Technical programming question (circular buffers &#38; logging) -->
<!--X-From-R13: Pra Uerrne <terrneNploreuvtujnl.arg> -->
<!--X-Date: Wed, 14 Jul 1999 19:34:00 &#45;0700 -->
<!--X-Message-Id: 378D3F1B.3770856B#cyberhighway,net -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Technical programming question (circular buffers &amp; l</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="msg00899.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00902.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00931.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00914.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00901">Author</A>
&nbsp;|&nbsp;<A HREF="#00901">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00901">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[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>" &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: [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>: Wed, 14 Jul 1999 18:53:31 -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>
Well, through no fault of my own *grin* a nasty bug has entered
my code!  It seems to be a memory corruption bug, as all good ones
are.

So, I turned on my verbose logging and after about 10 minutes I have a 15MB file.

(The trouble spot is called *very* often.)

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.

This would be nice because I could turn logging on a really
verbose level, and not fill up my HD.  Usually I only want
the last little bit of the log anyway.

I think I could write my own thing to do this, but I was wondering
if anyone knew of any tricks with files, or ready-built libraries
to do something like this...

Oh, one final thing:  If I keep it all in memory, I will want to
(at least) catch the SIGSEGV can flush it to disk at that time.
Does anyone forsee any problems with this??

Thanks a heap,
Ben


-- 
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>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00914" HREF="msg00914.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></strong>
<ul compact><li><em>From:</em> Greg Miller &lt;gmiller#classic-games,com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00899.html">Re: [MUD-Dev] list of MUD platforms?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00902.html">Re: [MUD-Dev] GM Touring Company</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00931.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00914.html">Re: [MUD-Dev] Technical programming question (circular buffers &amp; logging)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00901"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00901"><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>
<LI><strong><A NAME="00915" HREF="msg00915.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></strong>, 
Willowreed <a href="mailto:Willowreed#aol,com">Willowreed#aol,com</a>, Thu 15 Jul 1999, 22:05 GMT
</LI>
<LI><strong><A NAME="00928" HREF="msg00928.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></strong>, 
Bruce Mitchener, Jr. <a href="mailto:bruce#cybersight,com">bruce#cybersight,com</a>, Fri 16 Jul 1999, 22:35 GMT
<UL>
<LI><strong><A NAME="00929" HREF="msg00929.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></strong>, 
Joey Hess <a href="mailto:joey#kitenet,net">joey#kitenet,net</a>, Sat 17 Jul 1999, 02:56 GMT
<UL>
<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>
</LI>
</UL>
</LI>
</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
</LI>
</UL>
</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>