Open
Description
(Creating an issue for a PR)
None of these behaviours are documented:
ReadEvent()
andReadEvent(TimeSpan)
will returnnull
...- on the first attempt to read past the end of the query results (if running a query)
- on the first attempt to read past the last entry in the log-file on disk (if reading from a log directly).
- subsequent attempts to read will throw an
InvalidOperationException
- so reading must be stopped at the firstnull
.
- The
ReadEvent
method will returnEventLogRecord
objects instead ofEventRecord
- should this be documented too? - The
EventRecord
type isIDisposable
because it wraps anEventLogHandle
, but the documentation doesn't say if theEventRecord
orEventLogRecord
should always be disposed inside the read-loop or not, and if it's safe to pass theEventLogRecord
around or emit it in ayield break
.- I assume it should be eagerly-disposed and not exposed to callers, so the example in my PR copies scalar data from the
EventLogRecord
properties into aValueTuple
and emits those instead.
- I assume it should be eagerly-disposed and not exposed to callers, so the example in my PR copies scalar data from the
- The possible exceptions
System.Diagnostics.Eventing.Reader.EventLogException
(and subclasses) and ``InvalidOperationException` are not documented either.