[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] win32-eventlog 0.3.0

djberg96

10/30/2004 1:31:00 PM

Hi all,

The Win32Utils Team is happy to announce the release 0.3.0 of
win32-eventlog.

What is it?
===========
A Ruby interface for reading from and writing to the Windows Event
Log.

What's new?
===========
* The notify_change() and tail() methods have been added. These allow
you to put a watch on the event log, yielding a block with the latest
record whenever a record is written to the log.

* The read() method now returns an array of structs if no block is
given.

* Added the 'rubymsg.mc' message category file. If installed, this
will create a 'RubyMsg' event source for (eventual) use with
win32-service, though you may use it for whatever you wish. See the
README for more details.

* Added the write() alias for report_event().

* One bug fix involving EventLog::SEEK_READ.

Where is it?
============
You can find it on the RAA or on RubyForge at
http://www.rubyforge.org/projects/....

Enjoy!

- The Win32Utils Team
3 Answers

Martin DeMello

11/2/2004 12:39:00 PM

0

Daniel Berger <djberg96@hotmail.com> wrote:
>
> What is it?
> ===========
> A Ruby interface for reading from and writing to the Windows Event
> Log.

I took a look through the docs and examples, but couldn't find out if
this will let me write the app I want - basically something that will
print out the last n entries to the console. I started up notify.rb and
did a net send to localhost, but it didn't register - is that not the
sort of event you're talking about?

martin

djberg96

11/2/2004 9:20:00 PM

0

Martin DeMello <martindemello@yahoo.com> wrote in message news:<qdLhd.94069$nl.87634@pd7tw3no>...
> Daniel Berger <djberg96@hotmail.com> wrote:
> >
> > What is it?
> > ===========
> > A Ruby interface for reading from and writing to the Windows Event
> > Log.
>
> I took a look through the docs and examples, but couldn't find out if
> this will let me write the app I want - basically something that will
> print out the last n entries to the console. I started up notify.rb and
> did a net send to localhost, but it didn't register - is that not the
> sort of event you're talking about?
>
> martin

It didn't work because net send's are logged in the "System" log, not
the "Application" log. The latter is what EventLog.open() defaults to
if no source is specified. Modify the notify.rb script, and create an
EventLog object this way:

e = EventLog.open("System")

It worked fine for me. :)

HTH.

Dan

Martin DeMello

11/3/2004 6:33:00 AM

0

Daniel Berger <djberg96@hotmail.com> wrote:
>
> It didn't work because net send's are logged in the "System" log, not
> the "Application" log. The latter is what EventLog.open() defaults to
> if no source is specified. Modify the notify.rb script, and create an
> EventLog object this way:
>
> e = EventLog.open("System")
>
> It worked fine for me. :)

Perfect! Thanks - this is going to save me a lot of tedium.

martin