pw_log: Remove optional from protos

In proto3 all fields are optional by default, with the presence or not
being conveyed by the field having its default, zero, or empty value.

The 'optional' keyword is only required when presence with a default
value is meaningfully different from not present.

Change-Id: I8182ea505a3c06d9718c2526dcb9fda7aee21db0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/97741
Pigweed-Auto-Submit: Scott James Remnant <keybuk@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_log/log.proto b/pw_log/log.proto
index 14c3155..a97e9fe 100644
--- a/pw_log/log.proto
+++ b/pw_log/log.proto
@@ -83,7 +83,7 @@
   //   payload  = N bytes; typically 4-10 in practice
   //
   // Total: 2 + N ~= 6-12 bytes
-  optional bytes message = 1 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
+  bytes message = 1 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
 
   // Packed log level and line number. Structure:
   //
@@ -93,12 +93,12 @@
   // Note: This packing saves two bytes per log message in most cases compared
   // to having line and level separately; and is zero-cost if the log backend
   // omits the line number.
-  optional uint32 line_level = 2;
+  uint32 line_level = 2;
 
   // Some log messages have flags to indicate attributes such as whether they
   // are from an assert or if they contain PII. The particular flags are
   // product- and implementation-dependent.
-  optional uint32 flags = 3;
+  uint32 flags = 3;
 
   // Timestamps are either specified with an absolute timestamp or relative to
   // the previous log entry.
@@ -130,17 +130,17 @@
   // When the log buffers are full but more logs come in, the logs are counted
   // and a special log message is omitted with only counts for the number of
   // messages dropped.
-  optional uint32 dropped = 6;
+  uint32 dropped = 6;
 
   // The PW_LOG_MODULE_NAME for this log message.
-  optional bytes module = 7 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
+  bytes module = 7 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
 
   // The file path where this log was created, if not encoded in the message.
-  optional bytes file = 8 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
+  bytes file = 8 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
 
   // The task or thread name that created the log message. If the log was not
   // created on a thread, it should use a name appropriate to that context.
-  optional bytes thread = 9 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
+  bytes thread = 9 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
 
   // The following fields are planned but will not be added until they are
   // needed. Protobuf field numbers over 15 use an extra byte, so these fields
@@ -148,22 +148,22 @@
 
   // Represents the device from which the log originated. The meaning of this
   // field is implementation defined
-  // optional uint32 source_id = ?;
+  // uint32 source_id = ?;
 
   // Some messages are associated with trace events, which may carry additional
   // contextual data. This is a tuple of a data format string which could be
   // used by the decoder to identify the data (e.g. printf-style tokens) and the
   // data itself in bytes.
-  // optional bytes data_format = ?
+  // bytes data_format = ?
   //     [(tokenizer.format) = TOKENIZATION_OPTIONAL];
-  // optional bytes data = ?;
+  // bytes data = ?;
 }
 
 message LogRequest {}
 
 message LogEntries {
   repeated LogEntry entries = 1;
-  optional uint32 first_entry_sequence_id = 2;
+  uint32 first_entry_sequence_id = 2;
 }
 
 // RPC service for accessing logs.