grpc updated and dixed exception events to working order
This commit is contained in:
parent
84ff1f4275
commit
6b8857328e
3 changed files with 14 additions and 8 deletions
|
@ -492,6 +492,7 @@ def main():
|
|||
|
||||
# create session
|
||||
session_data = client.create_session()
|
||||
client.exception_events(session_data.id, lambda x: print(x))
|
||||
print("created session: {}".format(session_data))
|
||||
print("default services: {}".format(client.get_service_defaults(session_data.id)))
|
||||
print("emane models: {}".format(client.get_emane_models(session_data.id)))
|
||||
|
|
|
@ -522,16 +522,13 @@ class CoreApiServer(core_pb2_grpc.CoreApiServicer):
|
|||
try:
|
||||
event = queue.get(timeout=1)
|
||||
exception_event = core_pb2.ExceptionEvent()
|
||||
event_time = event.date
|
||||
if event_time is not None:
|
||||
event_time = float(event_time)
|
||||
update_proto(
|
||||
exception_event,
|
||||
node=event.node,
|
||||
session=event.session,
|
||||
level=event.level,
|
||||
session=int(event.session),
|
||||
level=event.level.value,
|
||||
source=event.source,
|
||||
date=event_time,
|
||||
date=event.date,
|
||||
text=event.text,
|
||||
opaque=event.opaque
|
||||
)
|
||||
|
|
|
@ -257,9 +257,9 @@ message ExceptionEventsRequest {
|
|||
message ExceptionEvent {
|
||||
int32 node = 1;
|
||||
int32 session = 2;
|
||||
string level = 3;
|
||||
ExceptionLevel level = 3;
|
||||
string source = 4;
|
||||
float date = 5;
|
||||
string date = 5;
|
||||
string text = 6;
|
||||
string opaque = 7;
|
||||
}
|
||||
|
@ -661,6 +661,14 @@ enum MobilityAction {
|
|||
MOBILITY_STOP = 2;
|
||||
}
|
||||
|
||||
enum ExceptionLevel {
|
||||
EXCEPTION_DEFAULT = 0;
|
||||
FATAL = 1;
|
||||
ERROR = 2;
|
||||
WARNING = 3;
|
||||
NOTICE = 4;
|
||||
}
|
||||
|
||||
message Hook {
|
||||
SessionState state = 1;
|
||||
string file = 2;
|
||||
|
|
Loading…
Reference in a new issue