Mail Archives: cygwin/2003/04/27/17:30:00
------=_NextPart_000_002C_01C30D0C.842CE810
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
[This subthread is going development-y, so moving it to
cygwin-apps AT cygwin DOT com]
Igor Pechtchanski wrote:
> Rob,
>
> I don't know how much extra effort it'll be, but wouldn't a
> "log-on-the-spot" command-line option make sense anyway? Or is that what
> you meant?
> Igor
Attatched is a patch implementing log-on-the-spot.
BEWARE: This patch is very old, and not resynced with HEAD.
Nevertheless, it might save someone 2 minutes or so reimplementing this.
Max.
------=_NextPart_000_002C_01C30D0C.842CE810
Content-Type: application/octet-stream;
name="Z-flush-log.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Z-flush-log.patch"
Index: LogFile.cc=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/LogFile.cc,v=0A=
retrieving revision 2.6=0A=
diff -u -p -r2.6 LogFile.cc=0A=
--- LogFile.cc 25 Nov 2002 00:41:24 -0000 2.6=0A=
+++ LogFile.cc 9 Mar 2003 00:17:10 -0000=0A=
@@ -102,6 +102,25 @@ LogFile::setFile (int minlevel, String c=0A=
}=0A=
=0A=
void=0A=
+LogFile::flush_log()=0A=
+{=0A=
+ for (FileSet::iterator i =3D files.begin();=0A=
+ i !=3D files.end(); ++i)=0A=
+ {=0A=
+ log_save (i->level, i->key, i->append);=0A=
+ }=0A=
+ LogEnt *l =3D first_logent;=0A=
+ first_logent =3D 0;=0A=
+ next_logent =3D &first_logent;=0A=
+ while (l)=0A=
+ {=0A=
+ LogEnt *next =3D l->next;=0A=
+ delete l;=0A=
+ l =3D next;=0A=
+ }=0A=
+}=0A=
+=0A=
+void=0A=
LogFile::exit (int const exit_code)=0A=
{=0A=
AntiVirus::AtExit();=0A=
@@ -208,6 +227,7 @@ LogFile::endEntry()=0A=
=
//string(theStream->str()).substr(0,theStream->rdbuf()->pcount()).c_str()=
);=0A=
// theStream->freeze(0);=0A=
delete theStream;=0A=
+ flush_log();=0A=
/* reset for next use */=0A=
theStream =3D new std::stringbuf;=0A=
rdbuf (theStream);=0A=
Index: LogFile.h=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/LogFile.h,v=0A=
retrieving revision 2.3=0A=
diff -u -p -r2.3 LogFile.h=0A=
--- LogFile.h 10 Nov 2002 03:56:05 -0000 2.3=0A=
+++ LogFile.h 9 Mar 2003 00:11:47 -0000=0A=
@@ -39,4 +39,5 @@ protected:=0A=
virtual void endEntry(); // the current in-progress entry is complete.=0A=
private:=0A=
void log_save (int babble, String const &filename, bool append);=0A=
+ void flush_log ();=0A=
};=0A=
------=_NextPart_000_002C_01C30D0C.842CE810
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_NextPart_000_002C_01C30D0C.842CE810--
- Raw text -