From af04d599054bb872bc8cc0af2084d716d1f92527 Mon Sep 17 00:00:00 2001 From: Keisuke Nakata Date: Thu, 9 Jan 2025 15:52:56 +0900 Subject: [PATCH] fix: remove timestamp and level fields --- proto/otaclient_iot_logging_server_v1.proto | 14 +------- .../v1/otaclient_iot_logging_server_v1_pb2.py | 22 ++++++------- .../otaclient_iot_logging_server_v1_pb2.pyi | 32 ++----------------- 3 files changed, 14 insertions(+), 54 deletions(-) diff --git a/proto/otaclient_iot_logging_server_v1.proto b/proto/otaclient_iot_logging_server_v1.proto index 05ab078..6f7e5ae 100644 --- a/proto/otaclient_iot_logging_server_v1.proto +++ b/proto/otaclient_iot_logging_server_v1.proto @@ -26,16 +26,6 @@ enum LogType { METRICS = 1; } -enum LogLevel { - UNSPECIFIC = 0; - TRACE = 1; - DEBUG = 2; - INFO = 3; - WARN = 4; - ERROR = 5; - FATAL = 6; -} - enum ErrorCode { NO_FAILURE = 0; // Success SERVER_QUEUE_FULL = 1; // Error: Server queue is full @@ -46,9 +36,7 @@ enum ErrorCode { message PutLogRequest { string ecu_id = 1; // target ECU ID LogType log_type = 2; // log type - uint64 timestamp = 3; // log timestamp (UNIX time in milliseconds) - LogLevel level = 4; // log level - string message = 5; // log message + string message = 3; // log message } message PutLogResponse { diff --git a/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.py b/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.py index 41ca817..e1ff355 100644 --- a/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.py +++ b/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.py @@ -13,7 +13,7 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\nIotaclient_iot_logging_server_pb2/v1/otaclient_iot_logging_server_v1.proto"y\n\rPutLogRequest\x12\x0e\n\x06\x65\x63u_id\x18\x01 \x01(\t\x12\x1a\n\x08log_type\x18\x02 \x01(\x0e\x32\x08.LogType\x12\x11\n\ttimestamp\x18\x03 \x01(\x04\x12\x18\n\x05level\x18\x04 \x01(\x0e\x32\t.LogLevel\x12\x0f\n\x07message\x18\x05 \x01(\t";\n\x0ePutLogResponse\x12\x18\n\x04\x63ode\x18\x01 \x01(\x0e\x32\n.ErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t*\x1f\n\x07LogType\x12\x07\n\x03LOG\x10\x00\x12\x0b\n\x07METRICS\x10\x01*Z\n\x08LogLevel\x12\x0e\n\nUNSPECIFIC\x10\x00\x12\t\n\x05TRACE\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\x08\n\x04WARN\x10\x04\x12\t\n\x05\x45RROR\x10\x05\x12\t\n\x05\x46\x41TAL\x10\x06*Z\n\tErrorCode\x12\x0e\n\nNO_FAILURE\x10\x00\x12\x15\n\x11SERVER_QUEUE_FULL\x10\x01\x12\x16\n\x12NOT_ALLOWED_ECU_ID\x10\x02\x12\x0e\n\nNO_MESSAGE\x10\x03\x32I\n\x1aOtaClientIoTLoggingService\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse"\x00\x62\x06proto3' + b'\nIotaclient_iot_logging_server_pb2/v1/otaclient_iot_logging_server_v1.proto"L\n\rPutLogRequest\x12\x0e\n\x06\x65\x63u_id\x18\x01 \x01(\t\x12\x1a\n\x08log_type\x18\x02 \x01(\x0e\x32\x08.LogType\x12\x0f\n\x07message\x18\x03 \x01(\t";\n\x0ePutLogResponse\x12\x18\n\x04\x63ode\x18\x01 \x01(\x0e\x32\n.ErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t*\x1f\n\x07LogType\x12\x07\n\x03LOG\x10\x00\x12\x0b\n\x07METRICS\x10\x01*Z\n\tErrorCode\x12\x0e\n\nNO_FAILURE\x10\x00\x12\x15\n\x11SERVER_QUEUE_FULL\x10\x01\x12\x16\n\x12NOT_ALLOWED_ECU_ID\x10\x02\x12\x0e\n\nNO_MESSAGE\x10\x03\x32I\n\x1aOtaClientIoTLoggingService\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse"\x00\x62\x06proto3' ) _globals = globals() @@ -26,16 +26,14 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _globals["_LOGTYPE"]._serialized_start = 261 - _globals["_LOGTYPE"]._serialized_end = 292 - _globals["_LOGLEVEL"]._serialized_start = 294 - _globals["_LOGLEVEL"]._serialized_end = 384 - _globals["_ERRORCODE"]._serialized_start = 386 - _globals["_ERRORCODE"]._serialized_end = 476 + _globals["_LOGTYPE"]._serialized_start = 216 + _globals["_LOGTYPE"]._serialized_end = 247 + _globals["_ERRORCODE"]._serialized_start = 249 + _globals["_ERRORCODE"]._serialized_end = 339 _globals["_PUTLOGREQUEST"]._serialized_start = 77 - _globals["_PUTLOGREQUEST"]._serialized_end = 198 - _globals["_PUTLOGRESPONSE"]._serialized_start = 200 - _globals["_PUTLOGRESPONSE"]._serialized_end = 259 - _globals["_OTACLIENTIOTLOGGINGSERVICE"]._serialized_start = 478 - _globals["_OTACLIENTIOTLOGGINGSERVICE"]._serialized_end = 551 + _globals["_PUTLOGREQUEST"]._serialized_end = 153 + _globals["_PUTLOGRESPONSE"]._serialized_start = 155 + _globals["_PUTLOGRESPONSE"]._serialized_end = 214 + _globals["_OTACLIENTIOTLOGGINGSERVICE"]._serialized_start = 341 + _globals["_OTACLIENTIOTLOGGINGSERVICE"]._serialized_end = 414 # @@protoc_insertion_point(module_scope) diff --git a/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.pyi b/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.pyi index 28edc88..6c5124b 100644 --- a/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.pyi +++ b/src/otaclient_iot_logging_server/v1/otaclient_iot_logging_server_v1_pb2.pyi @@ -1,10 +1,7 @@ -from typing import ClassVar as _ClassVar -from typing import Optional as _Optional -from typing import Union as _Union - +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -13,16 +10,6 @@ class LogType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): LOG: _ClassVar[LogType] METRICS: _ClassVar[LogType] -class LogLevel(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = [] - UNSPECIFIC: _ClassVar[LogLevel] - TRACE: _ClassVar[LogLevel] - DEBUG: _ClassVar[LogLevel] - INFO: _ClassVar[LogLevel] - WARN: _ClassVar[LogLevel] - ERROR: _ClassVar[LogLevel] - FATAL: _ClassVar[LogLevel] - class ErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = [] NO_FAILURE: _ClassVar[ErrorCode] @@ -32,36 +19,23 @@ class ErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): LOG: LogType METRICS: LogType -UNSPECIFIC: LogLevel -TRACE: LogLevel -DEBUG: LogLevel -INFO: LogLevel -WARN: LogLevel -ERROR: LogLevel -FATAL: LogLevel NO_FAILURE: ErrorCode SERVER_QUEUE_FULL: ErrorCode NOT_ALLOWED_ECU_ID: ErrorCode NO_MESSAGE: ErrorCode class PutLogRequest(_message.Message): - __slots__ = ["ecu_id", "log_type", "timestamp", "level", "message"] + __slots__ = ["ecu_id", "log_type", "message"] ECU_ID_FIELD_NUMBER: _ClassVar[int] LOG_TYPE_FIELD_NUMBER: _ClassVar[int] - TIMESTAMP_FIELD_NUMBER: _ClassVar[int] - LEVEL_FIELD_NUMBER: _ClassVar[int] MESSAGE_FIELD_NUMBER: _ClassVar[int] ecu_id: str log_type: LogType - timestamp: int - level: LogLevel message: str def __init__( self, ecu_id: _Optional[str] = ..., log_type: _Optional[_Union[LogType, str]] = ..., - timestamp: _Optional[int] = ..., - level: _Optional[_Union[LogLevel, str]] = ..., message: _Optional[str] = ..., ) -> None: ...