[plug] OT - logger etc
Peter Wright
pete at akira.apana.org.au
Mon Dec 31 10:46:13 WST 2001
Wayne,
On Sun, Dec 30, 2001 at 06:25:01PM -0800, Wayne Vovil wrote:
> Hi
>
> A bit off topic (actuallu a lot). Has anyone out there got some C source
> code for doing logging to a file. I don't wish to use syslog or daemons.
> I know I should just write to a file with some simple code; but why
> reinvent the wheel.
Why indeed.
However, your specific needs here are a bit... well, specific. :)
> Wayne
> PS what I REALLY want is all of the following:
Well - none of this stuff is particularly complicated, so while there is
no doubt various bits of code out there to do some of the stuff you want,
you may find it quicker and easier to write it yourself.
I mean, what is it you want to do?... maintain a number of TCP/IP sockets
with simple messages being passed around, and write stuff to debug file(s).
There's not a great deal of scope for abstraction here, if you know what I
mean. This is the sort of thing that a capable C programmer (that is
already familiar at least with socket handling issues) should be able to
implement in a day or so. A capable Perl/Python programmer could probably
implement it a lot quicker (it'd be quite a lot easier in Perl/Python),
maybe a few hours or even inside an hour.
Alternatively again, you _may_ even be able to use a program like netcat
inside a shell script. Or not, but netcat is a pretty useful program when
playing with stuff like this ( http://www.atstake.com/research/tools/nc110.tgz ).
> The objective:
[ ... ]
Well, at least it's fairly clearly specified. :)
Pete.
--
http://akira.apana.org.au/~pete/
--
... C++ offers even more flexible control over the visibility of member
objects and member functions. Specifically, members may be placed in the
public, private, or protected parts of a class. Members declared in the
public parts are visible to all clients; members declared in the private
parts are fully encapsulated; and members declared in the protected parts
are visible only to the class itself and its subclasses. C++ also supports
the notion of *friends*: cooperative classes that are permitted to see each
other's private parts.
-- Grady Booch, "Object Oriented Design with Applications"
More information about the plug
mailing list