Add some Eliot events related to fs notifications

This commit is contained in:
Jean-Paul Calderone 2019-03-12 15:00:15 -04:00
parent a9ec9c00bd
commit 0e3c4d40b8

View File

@ -18,6 +18,9 @@ __all__ = [
"opt_help_eliot_destinations",
"validateInstanceOf",
"validateSetMembership",
"MAYBE_NOTIFY",
"CALLBACK",
"INOTIFY_EVENTS",
"RELPATH",
"VERSION",
"LAST_UPLOADED_URI",
@ -54,6 +57,7 @@ from eliot import (
ILogger,
Message,
Field,
ActionType,
FileDestination,
add_destinations,
remove_destination,
@ -270,6 +274,27 @@ PATHINFO = Field(
validateInstanceOf((type(None), PathInfo)),
)
INOTIFY_EVENTS = Field(
u"inotify_events",
humanReadableMask,
u"Details about a filesystem event generating a notification event.",
validateInstanceOf((int, long)),
)
MAYBE_NOTIFY = ActionType(
u"filesystem:notification:maybe-notify",
[],
[],
u"A filesystem event is being considered for dispatch to an application handler.",
)
CALLBACK = ActionType(
u"filesystem:notification:callback",
[INOTIFY_EVENTS],
[],
u"A filesystem event is being dispatched to an application callback."
)
def eliot_logging_service(reactor, destinations):
"""
Parse the given Eliot destination descriptions and return an ``IService``